The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A290542 a(n) is the least integer k in the interval [2, sqrt(n)] such that k^n == k (mod n), or 0 if no such integer exists. 2

%I #25 Sep 08 2022 08:46:19

%S 0,2,0,2,0,0,0,2,0,2,0,0,0,2,0,2,0,0,0,2,0,0,0,0,4,2,0,2,0,0,0,0,0,2,

%T 0,0,0,2,0,2,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,2,0,0,0,5,3,2,0,0,0,2,

%U 0,2,0,0,0,0,0,2,0,0,0,2,0,4,0,0,0,2,0

%N a(n) is the least integer k in the interval [2, sqrt(n)] such that k^n == k (mod n), or 0 if no such integer exists.

%H Antti Karttunen, <a href="/A290542/b290542.txt">Table of n, a(n) for n = 4..20000</a>

%F a(A000040(n)) = 2 for n >= 3.

%F a(A001567(n)) = 2 for n >= 1.

%F a(A006935(n)) = 2 for n >= 2.

%F For n >= 3, a(x) = 2*A010051(x), where x = A000040(n).

%t Table[SelectFirst[Range[2, Sqrt@ n], PowerMod[#, n , n] == Mod[#, n] &] /. k_ /; MissingQ@ k -> 0, {n, 4, 90}] (* _Michael De Vlieger_, Aug 09 2017 *)

%o (Magma) lst:=[]; for n in [4..90] do r:=Floor(Sqrt(n)); for k in [2..r] do if Modexp(k, n, n) eq k then Append(~lst, k); break; end if; if k eq r then Append(~lst, 0); end if; end for; end for; lst;

%o (PARI) a(n) = for (k=2, sqrtint(n), if (Mod(k, n)^n == k, return(k));); return (0); \\ _Michel Marcus_, Aug 19 2017

%Y Cf. A010051, A290543.

%K nonn

%O 4,2

%A _Arkadiusz Wesolowski_, Aug 05 2017

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 June 8 03:56 EDT 2024. Contains 373207 sequences. (Running on oeis4.)