cp's OEIS Frontend

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.

A122149 Period of A002067 mod n.

This page as a plain text file.
%I A122149 #8 Dec 17 2012 09:29:01
%S A122149 1,1,1,4,8,1,3,4,9,8,10,4,24,3,8,4,32,9,18,8,3,10,22,4
%N A122149 Period of A002067 mod n.
%e A122149 A002067 mod 5 is 1, 1, 2, 2, 4, 4, 3, 3, 1, 1, 2, 2, 4, 4, 3, 3, 1, 1, ... with period 8.
%t A122149 max = 40; se = Series[InverseErf[2*x/Sqrt[Pi]], {x, 0, 2*max + 1}]; a[n_] := (2*n + 1)!/2^n*Coefficient[se, x, 2*n + 1]; A002067 = Table[a[n], {n, 0, max}]; period[lst_List] := Catch[lg = If[Length[lst] <= 5, 2, 5]; lst1 = lst[[1 ;; lg]]; km = Length[lst] - lg; Do[ If[lst1 == lst[[k ;; k+lg-1]], Throw[k-1]]; If[k == km, Throw[0]], {k, 2, km}]]; Table[period[Mod[A002067, n] // Reverse], {n, 1, 24}] (* _Jean-François Alcover_, Dec 17 2012 *)
%Y A122149 Cf. A002067, A122159.
%K A122149 nonn,more
%O A122149 1,4
%A A122149 _N. J. A. Sloane_, Aug 06 2008
%E A122149 Extended to 24 terms by _Jean-François Alcover_, Dec 17 2012