ganithaya sellam........................!!!!

madurax86

Member
Jun 29, 2006
4,385
88
0
Im.Just.a.Fool said:
Code:
    long solve(int n) {
        long x = 4, p2 = 2, ans=4;
        for (int i = 2; i <= n;  x*=p2,ans*=x, p2*=p2,i++);
        return ans;
    }

Loops are not available in mathematics:P
I asked for an expression that gives the value of all products till the nth term
I'll post it because no one posted the correct answer till now(what you posted is ok to get the answer but its not a 100% mathematical method)
 

madurax86

Member
Jun 29, 2006
4,385
88
0
if the r th term is Tr,
Tr=2^[1+2^(r-1)]

take log to the base e on both sides
Sn=T1.T2.T3...............Tn

ln|Sn| = ln|T1| + ln|T2|+ ln|T3| + ........+ln|Tn|
ln|Sn| = [1+2^0].ln|2| + [1+2^1].ln|2| + [1+2^2].ln|2| ...... +[1+2^(n-1)].ln|2|
ln|Sn| = {n + [1+2+4+8+......2^(n-1)] }.ln|2|

[1+2+4+8+......2^(n-1)] = 1.(2^n-1)/(2-1)=2^n-1

ln|Sn| = {n + 2^n-1 }.ln|2|
ln|Sn| = [2^n+n-1].ln|2|

taking anitln of both sides
Sn=2^[2^n+n-1]

tests, :P
S1=2^[2]=4 (the first term)
S2=2^[5]=32=4.8 (the product of first two terms)
S3=2^[10]=1024=4.8.32 (the product of first, second and third terms)

... and so on
 
Last edited:

Im.Just.a.Fool

Junior member
  • Apr 2, 2009
    202
    19
    18
    කියන්නෙම නෑ
    madurax86 said:
    Loops are not available in mathematics:P
    I asked for an expression that gives the value of all products till the nth term
    I'll post it because no one posted the correct answer till now(what you posted is ok to get the answer but its not a 100% mathematical method)

    Of course loops are not available in maths :D. me prashne dakkama mata nikan hithuna machan program ekak liyala balanna one kiyala ekai oka post kale. :)