%I #34 Sep 16 2022 10:27:19
%S 3,23,47,71,199,167,191,239,383,311,431,647,479,983,887,719,839,1031,
%T 1487,1439,1151,1847,1319,3023,1511,1559,2711,4463,2591,2399,3863,
%U 2351,3527,3719,3119,5471,2999,4703,6263,4391,3671,3911,4079,5279,6311,4679
%N Smallest odd prime p such that Q(sqrt(-p)) has class number 2n+1.
%C Note that all such primes are congruent to 3 modulo 4.
%C Conjecture: a(n) = A002146(n) for all n >= 1. That is to say, A002148(n) > A002146(n) for all n >= 1. - _Jianing Song_, Jul 20 2022
%C From _Jianing Song_, Sep 16 2022: (Start)
%C Note that an imaginary quadratic field has an odd class number if and only if it is of the form Q(sqrt(-1)), Q(sqrt(-2)), or Q(sqrt(-p)) for primes p == 3 (mod 4).
%C It seems that for most n, the class group of Q(sqrt(-a(n))) is the cyclic group of order 2*n+1. But this is not always true. The smallest prime p such that Q(sqrt(-p)) has class number 243 is p = 29399, and the class group of Q(sqrt(-29399)) is C_3 X C_81 rather than C_243. Also, the smallest prime p such that Q(sqrt(-p)) has class number 637 is p = 149519, and the class group of Q(sqrt(-149519)) is C_7 X C_91 rather than C_637. (End)
%F a(n) = min(A002146(n), A002148(n)). - _Jianing Song_, Jul 20 2022
%t << NumberTheory`NumberTheoryFunctions`
%t a = Table[0, {101}]; Do[ c = ClassNumber[ -Prime[n] ]; If[ c < 102 && a[ [c] ] == 0, a[ [c] ] = Prime[n] ], {n, 2, 4000} ]; Table[ a[ [n] ], {n, 1, 101} ]
%t a = Table[0, {101}]; Do[c = NumberFieldClassNumber[Sqrt[-Prime[n]]]; If[c < 102 && a[[c]] == 0, a[[c]] = Prime[n]], {n, 2, 4000}]; Select[ Table[a[[n]], {n, 1, 101}], Mod[#, 4] == 3 &] (* _Jean-François Alcover_, Jul 20 2022 *)
%o (PARI) a(n) = forprime(p=3, oo, if ((p % 4) == 3, if (qfbclassno(-p) == 2*n+1, return(p)))); \\ _Michel Marcus_, Jul 20 2022
%Y Cf. A002146, A002148.
%K nonn
%O 0,1
%A _Robert G. Wilson v_, Apr 17 2001
%E Offset corrected by _Michel Marcus_, Jul 20 2022