%I #31 Jun 11 2026 08:18:37
%S 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,1,0,
%T 0,1,0,0,0,1,0,1,0,1,0,0,1,0,0,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1,1,
%U 0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,1,0,0,1,0,1,0,1,0,1
%N 2-rank of the class group of the real quadratic field with discriminant A003658(n), n >= 2.
%C Not to be confused with A317991, which gives the 2-ranks of the *form class groups* of real quadratic fields.
%H Jianing Song, <a href="/A391436/b391436.txt">Table of n, a(n) for n = 2..10000</a>
%H Rick L. Shepherd, <a href="https://www.digitalgreensboro.org/record/14435">Binary quadratic forms and genus theory</a>, Master of Arts Thesis, University of North Carolina at Greensboro, 2013.
%F For D = A003658(n), we have a(n) = A317991(n) - 1 if D has a prime factor congruent to 3 modulo 4, A317991(n) otherwise. (See A391439 for a proof). Note that A317991(n) = omega(D) - 1.
%o (PARI) r(D) = my(w = omega(D) - 1); my(f = factor(D)[,1]~); for(i=1, #f, if(f[i]%4==3, return(w-1))); return(w) \\ gives 2-rank of Cl(D) for fundamental D
%o for(D=1, 1000, if(D>1 && isfundamental(D), print1(r(D), ", ")))
%Y Cf. A319659 (for imaginary quadratic fields).
%Y For a list of sequences related to the class groups of real quadratic fields, see A390079.
%K nonn
%O 2,159
%A _Jianing Song_, Dec 09 2025