[go: up one dir, main page]

login
a(n) = number of terms in the continued fraction of the absolute value of B_n, the n-th Bernoulli number.
3

%I #10 Dec 18 2018 17:04:20

%S 1,2,2,1,2,1,2,1,2,1,3,1,6,1,2,1,7,1,7,1,4,1,4,1,6,1,2,1,6,1,7,1,7,1,

%T 2,1,10,1,2,1,8,1,2,1,3,1,5,1,10,1,3,1,7,1,7,1,6,1,6,1,17,1,2,1,7,1,

%U 10,1,2,1,7,1,23,1,2,1,2,1,5,1,18,1,5,1,16,1,2,1,10,1,14,1,6,1,2,1,18,1,2,1

%N a(n) = number of terms in the continued fraction of the absolute value of B_n, the n-th Bernoulli number.

%C The continued fraction terms being counted include the initial 0, if there is one. (a(n), for all odd n >= 3, is 1.)

%H Antti Karttunen, <a href="/A138702/b138702.txt">Table of n, a(n) for n = 0..16383</a>

%e The 12th Bernoulli number is -691/2730. Now 691/2730 has the continued fraction 0 + 1/(3 + 1/(1 + 1/(19 + 1/(3 + 1/11)))), which has 6 terms (including the zero). So a(12) = 6.

%o (PARI)

%o lcf(x)=local(r);r=1;while(1,x-=floor(x);if(x==0,return(r));x=1/x;r++)

%o a(n)=lcf(abs(bernfrac(n))) \\ _Franklin T. Adams-Watters_, May 14 2010

%Y Cf. A138701, A138703.

%K nonn

%O 0,2

%A _Leroy Quet_, Mar 26 2008

%E More terms from _Franklin T. Adams-Watters_, May 14 2010