login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Triangle T(n,k) giving 2*p mod n-1, where p = period of sequence k^i (i=0,1,2,...) mod n (n >= 2, 2<=k<=n).
2

%I #7 Feb 04 2015 04:26:15

%S 0,0,0,2,1,2,0,0,0,2,4,2,2,4,2,0,0,0,0,4,2,2,4,2,4,2,4,2,4,2,6,4,2,6,

%T 4,2,8,8,4,2,2,8,8,4,2,0,0,0,0,0,0,0,0,4,2,4,4,2,4,2,4,4,2,2,4,2,0,6,

%U 0,8,0,0,8,6,0,0,4,2

%N Triangle T(n,k) giving 2*p mod n-1, where p = period of sequence k^i (i=0,1,2,...) mod n (n >= 2, 2<=k<=n).

%e 0; 0,0; 2,1,2; 0,0,0,2; ...

%t period[lst_] := Module[{n, i, j}, n = Length[lst]; For[j = 2, j <= n, j++, For[i = 1, i < j, i++, If[lst[[i]] == lst[[j]], Return[{i - 1, j - i}]]]]; Return[{0, 0}]]; T[n_, k_] := Module[{t, p}, t = Table[PowerMod[k, i, n], {i, 0, 2 n}]; p = period[t][[2]]; Mod[2 p, n - 1]]; Table[T[n, k], {n, 2, 13}, {k, 2, n}] // Flatten (* _Jean-François Alcover_, Feb 04 2015 *)

%Y Cf. A057593, A057594.

%K nonn,tabl,nice

%O 2,4

%A _Gottfried Helms_, Oct 05 2000