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

A308972
Least k > 0 such that A114561(k) == A114561(k+1) mod n.
1
1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 1, 2, 2, 2, 1, 2, 2, 1, 3, 4, 2, 3, 2, 2, 1, 2, 2, 3, 2, 3, 2, 2, 1, 2, 2, 2, 2, 3, 1, 2, 3, 2, 4, 5, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 3, 3, 1, 2, 2, 3, 4, 2, 4, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 3, 4, 1, 2, 2, 2
OFFSET
1,5
COMMENTS
A114561(k+1) - A114561(k) is the largest n such that a(n) = k.
FORMULA
a(n) <= A003434(n).
a(n) <= a(A000010(n)) + 1. Proof: a(n) <= a(eulerphi(n)) + 1. Proof: If A114561(i) == b(i) mod eulerphi(n), 0 < b(i) <= eulerphi(n), then a(n) is the least k > 0 such that 2^b(k-1) == 2^b(k) mod n. Since A114561(a(eulerphi(n))) == A114561(a(eulerphi(n)) + 1), k <= a(A000010(n)) + 1.
EXAMPLE
4, 4^4, 4^4^4, ... mod 8 equal 4, 0, 0, ..., so A114561(k) mod 8 = 0 for all k >= 2, hence a(8) = 2.
PROG
(PARI) a(n) = {c=0; k=1; x=0; d=n; while(k==1, z=x++; y=0; b=1; while(z>0, while(y++<z, d=eulerphi(d)); b=4^b-floor((4^b-1)/d)*d; z=z-1; y=0; d=n); if(c==b, k=0); c=b); x-1; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Jinyuan Wang, Aug 30 2019
STATUS
approved