A006266 A continued cotangent.
2, 14, 2786, 21624372014, 10111847525912679844192131854786, 1033930953043290626825587838528711318150300040875029341893199068078185510802565166824630504014
Offset: 0
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- G. C. Greubel, Table of n, a(n) for n = 0..7
- Jeffrey Shallit, Predictable regular continued cotangent expansions, J. Res. Nat. Bur. Standards Sect. B 80B (1976), no. 2, 285-290.
Programs
-
Magma
[Evaluate(DicksonFirst(3^n, -1), 2): n in [0..7]]; // G. C. Greubel, Mar 25 2022
-
Maple
a := proc(n) option remember; if n = 1 then 14 else a(n-1)^3 + 3*a(n-1) end if; end: seq(a(n), n = 1..5); # Peter Bala Nov 15 2022
-
Mathematica
Table[Round[(1+Sqrt[2])^(3^n)],{n,0,10}] (* Artur Jasinski, Sep 24 2008 *) LucasL[3^Range[0, 7], 2] (* G. C. Greubel, Mar 25 2022 *)
-
PARI
a(n,s=2)=for(i=2,n,s*=(s^2+3));s \\ M. F. Hasler, Oct 06 2014
-
Sage
[lucas_number2(3^n,2,-1) for n in (0..7)] # G. C. Greubel, Mar 25 2022
Formula
From Artur Jasinski, Sep 24 2008: (Start)
a(n+1) = a(n)^3 + 3*a(n) with a(0) = 2.
a(n) = round((1+sqrt(2))^(3^n)). [Corrected by M. F. Hasler, Oct 06 2014] (End)
From Peter Bala, Nov 15 2022: (Start)
a(n) = A002203(3^n).
a(n) = L(3^n,2), where L(n,x) denotes the n-th Lucas polynomial of A114525.
a(n) == 2 (mod 3).
a(n+1) == a(n) (mod 3^(n+1)) for n >= 1 (a particular case of the Gauss congruences for the companion Pell numbers).
The smallest positive residue of a(n) mod(3^n) = A271222(n).
Extensions
Edited by M. F. Hasler, Oct 06 2014
Offset corrected by G. C. Greubel, Mar 25 2022
Comments