%I #17 Feb 24 2021 08:16:59
%S 0,1,0,1,1,1,1,0,1,2,0,1,1,1,1,1,0,2,1,1,1,2,0,1,2,0,2,1,1,1,2,0,2,1,
%T 1,1,0,1,1,2,1,1,2,1,0,1,1,2,1,1,1,1,1,2,0,2,1,1,2,0,0,2,1,2,1,1,0,2,
%U 2,0,2,2,1,2,1,2,1,1,2,1,1,1,0,2,1,1,1
%N 2-rank of the narrow class group of real quadratic field Q(sqrt(k)), k squarefree > 1.
%C The p-rank of a finite abelian group G is equal to log_p(#{x belongs to G : x^p = 1}) where p is a prime number. In this case, G is the narrow class group of Q(sqrt(k)) or the form class group of indefinite binary quadratic forms with discriminant k, and #{x belongs to G : x^p = 1} is the number of genera of Q(sqrt(k)) (cf. A317990).
%C This is the analog of A319662 for real quadratic fields.
%H Rick L. Shepherd, <a href="https://libres.uncg.edu/ir/uncg/listing.aspx?id=15057">Binary quadratic forms and genus theory</a>, Master of Arts Thesis, University of North Carolina at Greensboro, 2013.
%F a(n) = omega(A005117(n)) - 1 = log_2(A317990(n)), where omega(k) is the number of distinct prime divisors of k.
%o (PARI) for(n=2, 200, if(issquarefree(n), print1(omega(n*if(n%4>1, 4, 1)) - 1, ", ")))
%Y Cf. A005117, A087048, A317990, A317991, A319662.
%K nonn
%O 2,10
%A _Jianing Song_, Oct 03 2018
%E Offset corrected by _Jianing Song_, Mar 31 2019