A306493 a(n) is the least number such that the n-th prime is the least coprime quadratic nonresidue modulo a(n).
3, 4, 6, 22, 118, 479, 262, 3622, 5878, 18191, 24022, 132982, 296278, 366791, 1289738, 4539478, 6924458, 13620602, 32290442, 175244281, 86060762, 326769242, 131486759, 84286438, 937435558
Offset: 1
Examples
For k = 118 we have: 2 is not coprime to 118, 11^2 == 3 (mod 118), 51^2 == 5 (mod 118), 19^2 == 7 (mod 118) and 11 is a quadratic nonresidue modulo 118. For all k < 118, at least one of 2, 3, 5, 7 is coprime quadratic nonresidue modulo k, so a(5) = 118.
Crossrefs
Cf. A000229.
Programs
-
PARI
b(p,k) = gcd(p,k)==1&&!issquare(Mod(p,k)) a(n) = my(k=1); while(sum(i=1,n-1,b(prime(i),k))!=0 || !b(prime(n),k), k++); k
Extensions
a(17)-a(23) from Daniel Suteu, Feb 24 2019
a(24)-a(25) from Jinyuan Wang, Mar 08 2019
Comments