This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A228488 #7 Dec 04 2016 19:46:32 %S A228488 0,1,1,0,1,1,1,1,0,1,1,1,3,1,1,0,1,1,4,1,2,4,1,1,0,1,1,1,4,1,6,1,1,1, %T A228488 1,0,1,1,1,1,1,1,6,1,4,8,1,1,0,1,1,4,4,4,1,1,2,4,4,1,7,1,1,0,1,1,8,1, %U A228488 6,4,6,1,5,3,1,8,4,1,1,1,0,1,1,1,4,6 %N A228488 Period length of trace(sqrt(n)). %C A228488 It is assumed that trace(sqrt(n)) is purely periodic, as conjectured at A228487 where trace is defined. %C A228488 If n is a square, then trace(sqrt(n)) is the empty word, denoted by E. Examples: %C A228488 n ........... trace(sqrt(n)) %C A228488 1 ........... E %C A228488 2 ........... 000000000... %C A228488 3 ........... 111111111... %C A228488 4 ........... E %C A228488 5 ........... 000000000... %C A228488 6 ........... 000000000... %C A228488 7 ........... 111111111... %C A228488 8 ........... 111111111... %C A228488 9 ........... E %C A228488 10 .......... 000000000... %C A228488 11 .......... 000000000... %C A228488 12 .......... 000000000... %C A228488 13 .......... 110(repeated) %C A228488 19 .......... 0110(repeated) %C A228488 22 .......... 1001(repeated) %C A228488 31 .......... 100010(repeated) %C A228488 46 .......... 11000101(repeated) %e A228488 a(13) = 3 because the trace(sqrt(13)) = 110(repeated) has period length 3. %t A228488 $MaxExtraPrecision = Infinity; period[seq_] := (If[Last[#1] == {} || Length[#1] == Length[seq] - 1, 0, Length[#1]] &)[NestWhileList[Rest, Rest[seq], #1 != Take[seq, Length[#1]] &, 1]]; periodicityReport[seq_] := ({Take[seq, Length[seq] - Length[#1]], period[#1], Take[#1, period[#1]]} &)[Take[seq, -Length[NestWhile[Rest[#1] &, seq, period[#1] == 0 &, 1, Length[seq]]]]] %t A228488 (*output format: {initial segment, period length, period}*) %t A228488 t[{x_, y_, _}] := t[{x, y}]; t[{x_, y_}] := Prepend[If[# > y - #, {y - #, 1}, {#, 0}], y]&[Mod[x, y]]; userIn2[{x_, y_}] := Most[NestWhileList[t, {x, y}, (#[[2]] > 0) &]]; %t A228488 z = 160; pr = Table[If[IntegerQ[Sqrt[n]], {0, 0}, p = Convergents[Sqrt[n], z]; pairs = Table[{Numerator[#], Denominator[#]} &[p[[k]]], {k, 1, z}]; periodicityReport[ Most[Last[Map[Map[#[[3]] &, Rest[userIn2[#]]] &, pairs]]]]], {n, 120}] %t A228488 m = Map[#[[2]] &, pr] (* _Peter J. C. Moses_, Aug 22 2013 *) %Y A228488 Cf. A228487, A228489. %K A228488 nonn %O A228488 0,13 %A A228488 _Clark Kimberling_, Aug 23 2013