A071915 Number of 1's in the continued fraction expansion of (3/2)^n.
0, 0, 1, 0, 2, 3, 3, 6, 3, 5, 1, 2, 8, 2, 3, 5, 2, 3, 3, 6, 10, 8, 6, 4, 2, 3, 6, 5, 2, 9, 12, 7, 17, 10, 7, 9, 8, 10, 13, 13, 10, 12, 14, 9, 11, 10, 11, 6, 9, 5, 3, 13, 13, 19, 18, 13, 8, 12, 15, 14, 18, 7, 19, 19, 17, 15, 13, 14, 16, 13, 20, 16, 10, 20, 25, 17, 19, 14, 19, 14, 18, 22
Offset: 1
Examples
The continued fraction of (3/2)^24 is [16834, 8, 1, 10, 2, 25, 1, 3, 1, 1, 57, 6] which contains 4 "1's", hence a(24)=4.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[1] = 0; a[n_] := Count[ContinuedFraction[(3/2)^n], 1]; Array[a, 100] (* Amiram Eldar, Sep 05 2020 *)
-
PARI
for(n=1,200,s=contfrac(frac((3/2)^n)); print1(sum(i=1,length(s),if(1-component(s,i),0,1)),","))
Comments