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!)
A366973 Smallest odd prime p such that n^((p+1)/2) == n (mod p). 4
3, 3, 7, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 13, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 11, 3, 3, 5, 3, 3, 5, 3, 3, 11, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 13, 3, 3, 5, 3, 3, 13, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 17, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
a(n) is the smallest odd prime p for which the Legendre symbol (n / p) >= 0.
For any set S of odd primes, by Chinese Remainder Theorem, there is n such that n is a primitive root mod each prime p in S, and then n^((p-1)/2) =/= 1 (mod p). Since n is invertible mod p, n^((p-1)/2) =/= 1 (mod p) implies n^((p+1)/2) =/= n (mod p). So this sequence is unbounded. - Robert Israel, Oct 31 2023
LINKS
MAPLE
f:= proc(n) local p;
p:= 2;
do
p:= nextprime(p);
if n &^ ((p+1)/2) - n mod p = 0 then return p fi
od
end proc:
map(f, [$0..100]); # Robert Israel, Oct 30 2023
MATHEMATICA
a[n_] := Module[{p = 3}, While[PowerMod[n, (p + 1)/2, p] != Mod[n, p], p = NextPrime[p]]; p]; Array[a, 100, 0] (* Amiram Eldar, Oct 30 2023 *)
PROG
(PARI) a(n) = my(p=3); while(Mod(n, p)^((p+1)/2) != n, p=nextprime(p+1)); p; \\ Michel Marcus, Oct 30 2023
CROSSREFS
Sequence in context: A089488 A367034 A366982 * A076560 A359048 A096915
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Oct 30 2023
EXTENSIONS
More terms from Amiram Eldar, Oct 30 2023
STATUS
approved

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 April 29 12:16 EDT 2024. Contains 372114 sequences. (Running on oeis4.)