login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A176338 a(n) = 1 + (1-3^n)*a(n-1) for n >=1, a(0) = 0. 4

%I

%S 0,1,-7,183,-14639,3542639,-2579041191,5637784043527,

%T -36983863325537119,727916397973221576159,-42982007467522787629036631,

%U 7614090694841791737333323035127,-4046432358866721800888421193787892879

%N a(n) = 1 + (1-3^n)*a(n-1) for n >=1, a(0) = 0.

%H G. C. Greubel, <a href="/A176338/b176338.txt">Table of n, a(n) for n = 0..64</a>

%p A176338 := proc(n)

%p if n = 0 then

%p 0;

%p else

%p 1+(1-3^n)*procname(n-1) ;

%p end if;

%p end proc: # _R. J. Mathar_, May 04 2013

%t a[n_, q_]:= a[n, q]= If[n==0, 0, (1-q^n)*a[n-1, q] +1]; Table[a[n, 3], {n,0,15}]

%o (PARI) q=3; a(n,q) = if(n==0, 0, 1 -(q^n-1)*a(n-1,q) );

%o vector(16, n, a(n-1,3)) \\ _G. C. Greubel_, Dec 07 2019

%o (MAGMA)

%o function a(n,q)

%o if n eq 0 then return 0;

%o else return 1 - (q^n-1)*a(n-1,q);

%o end if; return a; end function;

%o [a(n,3): n in [0..15]]; // _G. C. Greubel_, Dec 07 2019

%o (Sage)

%o def a(n, q):

%o if (n==0): return 0

%o else: return 1 - (q^n-1)*a(n-1,q)

%o [a(n,3) for n in (0..15)] # _G. C. Greubel_, Dec 07 2019

%o (GAP)

%o a:= function(n,q)

%o if n=0 then return 0;

%o else return 1 - (q^n-1)*a(n-1,q);

%o fi; end; List([0..15], n-> a(n,3) ); # _G. C. Greubel_, Dec 07 2019

%Y Cf. A176337.

%K sign,easy

%O 0,3

%A _Roger L. Bagula_, Apr 15 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 18 13:54 EDT 2021. Contains 347527 sequences. (Running on oeis4.)