login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A146326 Length of the period of the continued fraction of (1+sqrt(n))/2. 40

%I #29 May 01 2021 06:48:59

%S 0,2,2,0,1,4,4,4,0,2,2,2,1,4,2,0,3,6,6,4,2,6,4,4,0,2,2,4,1,2,8,4,4,4,

%T 2,0,3,6,6,8,5,4,10,6,2,8,4,4,0,2,2,4,1,6,4,2,6,6,6,4,3,4,2,0,3,6,10,

%U 6,4,6,8,4,9,6,4,8,2,4,4,4,0,2,2,2,1,6,2,8,7,2,8,8,2,12,4,8,9,4,2,0

%N Length of the period of the continued fraction of (1+sqrt(n))/2.

%C First occurrence of n in this sequence see A146343.

%C Records see A146344.

%C Indices where records occurred see A146345.

%C a(n) =0 for n = k^2 (A000290).

%C a(n) =1 for n = 4 k^2 + 4 k + 5 (A078370). For primes see A005473.

%C a(n) =2 for n in A146327. For primes see A056899.

%C a(n) =3 for n in A146328. For primes see A146348.

%C a(n) =4 for n in A146329. For primes see A028871 - {2}.

%C a(n) =5 for n in A146330. For primes see A146350.

%C a(n) =6 for n in A146331. For primes see A146351.

%C a(n) =7 for n in A146332. For primes see A146352.

%C a(n) =8 for n in A146333. For primes see A146353.

%C a(n) =9 for n in A143577. For primes see A146354.

%C a(n)=10 for n in A146334. For primes see A146355.

%C a(n)=11 for n in A146335. For primes see A146356.

%C a(n)=12 for n in A146336. For primes see A146357.

%C a(n)=13 for n in A333640. For primes see A146358.

%C a(n)=14 for n in A146337. For primes see A146359.

%C a(n)=15 for n in A146338. For primes see A146360.

%C a(n)=16 for n in A146339. For primes see A146361.

%C a(n)=17 for n in A146340. For primes see A146362.

%H R. J. Mathar, <a href="/A146326/b146326.txt">Table of n, a(n) for n = 1..20000</a>.

%F a(n) = 0 iff n is a square (A000290). - _Robert G. Wilson v_, Apr 11 2017

%e a(2) = 2 because continued fraction of (1+sqrt(2))/2 = 1, 4, 1, 4, 1, 4, 1, ... has period (1,4) length 2.

%p A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: seq(A146326(n),n=1..100) ; # _R. J. Mathar_, Sep 06 2009

%t Table[cf = ContinuedFraction[(1 + Sqrt[n])/2]; If[Head[cf[[-1]]] === List, Length[cf[[-1]]], 0], {n, 100}]

%t f[n_] := Length@ ContinuedFraction[(1 + Sqrt[n])/2][[-1]]; Array[f, 100] (* _Robert G. Wilson v_, Apr 11 2017 *)

%Y Cf. A003285, A146343, A146344, A146345.

%Y Cf. also A000290, A078370, A146327-A146342; A005473, A056899, A146348-A146362.

%K nonn

%O 1,2

%A _Artur Jasinski_, Oct 30 2008

%E a(39) and a(68) corrected by _R. J. Mathar_, Sep 06 2009

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 16:52 EDT 2024. Contains 371962 sequences. (Running on oeis4.)