A028833 Index of redundancy in period of continued fraction for sqrt(n).
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 2, 0, 3, 2, 1, 0, 0, 0, 0, 1, 2, 0, 4, 2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 6, 5, 3, 7, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 3, 5, 2, 1, 6, 1, 0, 0, 0, 0, 5, 0, 4, 3, 4, 0, 4, 3, 2, 7, 2, 1, 1, 0, 0, 0, 0, 0, 2, 6, 0, 3, 2, 0, 5, 4, 6, 10, 1, 1, 8, 1, 0, 0, 0, 0
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_] := If[IntegerQ[Sqrt[n]], 0, Length[p = ContinuedFraction[Sqrt[n]] // Last] - Length[p // Union]]; Table[a[n], {n, 1, 102}] (* Jean-François Alcover, Dec 26 2012 *)