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

A128867
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
4, 5, 31, 106, 53, 582, 318, 9528, 11201, 19174, 142177, 315394, 648675
OFFSET
1,1
EXAMPLE
For a(1), the sequence is 1, 2, 3, 5, 11, 2, 3, 5, 11, 2, 3,
5, 11, ... The sequence has period {2, 3, 5, 11} so a(1) = 4.
For a(2) see the A112279: 1, 2, 3, 5, 11, 31, 127, 103, 5,
11, 31, 127, 103, 5, 11, ..., . This sequence has a cyclic length of 5.
MATHEMATICA
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]
CROSSREFS
Sequence in context: A265709 A265708 A224219 * A262031 A326998 A270286
KEYWORD
nonn,more
AUTHOR
Robert G. Wilson v, Apr 05 2007
EXTENSIONS
a(11) from Chai Wah Wu, Sep 26 2019
a(12)-a(13) from Chai Wah Wu, Oct 02 2019
a(11) and a(12) verified by Robert G. Wilson v, Oct 22 2019
STATUS
approved