login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A308964 Least k > 0 such that A014222(k) == A014222(k+1) (mod n). 1

%I #42 Oct 23 2019 16:37:36

%S 1,1,1,1,2,1,2,1,2,2,3,1,2,2,2,2,3,2,3,2,2,3,4,1,3,2,2,2,3,2,3,2,3,3,

%T 2,2,3,3,2,2,2,2,3,3,2,4,5,2,3,3,3,2,3,2,3,2,3,3,4,2,3,3,2,3,2,3,4,3,

%U 4,2,3,2,2,3,3,3,3,2,3,2,3,2,3,2,3,3,3

%N Least k > 0 such that A014222(k) == A014222(k+1) (mod n).

%C a(n) is the least positive integer k such that the sequence {A014222(i) mod n} for i >= k is constant. Proof: if g(i) = A014222(i), then n divides 3^g(i-1)*(3^(g(i)-g(i-1)) - 1) when g(i) == g(i+1) (mod n). g(j)-g(j-1) divides g(j+1)-g(j) for any j > 0, therefore, 3^(g(i)-g(i-1)) - 1 divides 3^(g(i+1)-g(i)) - 1. Then n divides 3^g(i)*(3^(g(i+1)-g(i)) - 1) = g(i+2) - g(i+1), that is, g(i) == g(i+1) == g(i+2) (mod n). Since a(n) is the least positive integer k such that g(k) == g(k+1) (mod n), the sequence {A014222(i) mod n} for i >= k is constant.

%C A014222(k+1) - A014222(k) is the largest n such that a(n) = k.

%F a(n) <= A003434(n).

%F a(n) <= a(A000010(n)) + 1.

%e 3, 27, 7625597484987, ... mod 5 equal 3, 2, 2, ..., so A014222(k) mod 5 = 2 for all k >= 2, hence a(5) = 2.

%o (PARI) a(n) = {my(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=3^b-floor((3^b-1)/d)*d; z=z-1; y=0; d=n); if(c==b, k=0); c=b); x-1; }

%Y Cf. A014222, A308972, A322418.

%K nonn

%O 1,5

%A _Jinyuan Wang_, Aug 30 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 7 15:23 EDT 2024. Contains 375017 sequences. (Running on oeis4.)