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”).

Let f(i) = prime( f(i - 1) (modulo 10^n) ) with f(0) = 1; a(n) is the length of the period of the sequence f(i).
2

%I #15 Oct 25 2019 16:57:17

%S 4,5,31,106,53,582,318,9528,11201,19174,142177,315394,648675

%N Let f(i) = prime( f(i - 1) (modulo 10^n) ) with f(0) = 1; a(n) is the length of the period of the sequence f(i).

%e For a(1), the sequence is 1, 2, 3, 5, 11, 2, 3, 5, 11, 2, 3,

%e 5, 11, ... The sequence has period {2, 3, 5, 11} so a(1) = 4.

%e For a(2) see the A112279: 1, 2, 3, 5, 11, 31, 127, 103, 5,

%e 11, 31, 127, 103, 5, 11, ..., . This sequence has a cyclic length of 5.

%t f[n_] := Block[{k = 1, a}, a[0] = 1; a[i_] := a[i] = Prime[Mod[a[i - 1], 10^n]]; While[t = Table[a[i], {i, 0, k - 1}]; MemberQ[t, a[k]] == False, k++ ]; k + 1 - Flatten[ Position[ t, a[k]]][[1]]]; Array[ f, 10]

%K nonn,more

%O 1,1

%A _Robert G. Wilson v_, Apr 05 2007

%E a(11) from _Chai Wah Wu_, Sep 26 2019

%E a(12)-a(13) from _Chai Wah Wu_, Oct 02 2019

%E a(11) and a(12) verified by _Robert G. Wilson v_, Oct 22 2019