OFFSET
1,1
COMMENTS
A companion sequence to A092419.
Conjecture: lim sup log(a(n))/log(n) = 0. For example, it seems that log(a(n))/log(n) < 0.5 for all n > 1364.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 2 if and only if n == 3, 5 (mod 8). See A047621.
a(n) = 3 if and only if n == 1, 4, 7, 10, 16, 22 (mod 24).
MAPLE
# This requires Maple 2016 or later
f:= proc(n) local p;
p:= 2;
while NumberTheory:-KroneckerSymbol(-n, p) <> -1 do p:= nextprime(p) od:
p
end proc:
map(f, [$1..100]); # Robert Israel, Feb 17 2019
MATHEMATICA
a[n_] := For[p = 2, True, p = NextPrime[p], If[KroneckerSymbol[-n, p] == -1, Return[p]]];
Array[a, 100] (* Jean-François Alcover, Jun 18 2020 *)
PROG
(PARI) a(n) = forprime(p=2, , if(kronecker(-n, p)<0, return(p)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Jan 29 2019
STATUS
approved