OFFSET
1,3
COMMENTS
We have h(-7*n^2), the class number of the order of Z[(1+sqrt(-7))/2] with discriminant -7*n^2, is equal to a(n).
In general, let d < 0 be a fundamental discriminant and n be a positive integer such that d*n^2 < -4, then h(d*n^2) = L(0,kronecker(d,.)) * n * Product_{p|n, p prime} (1 - kronecker(d,p)/p). This is a combination of Theorem 7.24 in "Primes of the form x^2+ny^2" by Cox and the Dirichlet class number formula. Here L(0,kronecker(-7,.)) = 1.
REFERENCES
D. A. Cox, Primes of the form x^2+ny^2, Wiley, New York, 1989, p. 146.
LINKS
Jianing Song, Table of n, a(n) for n = 1..10000
FORMULA
Multiplicative with a(7^e) = 7^e, a(p^e) = p^(e-1)*(p-1) if p == 1, 2, 4 (mod 7) and a(p^e) = p^(e-1)*(p+1) if p == 3, 5, 6 (mod 7).
EXAMPLE
Given L(0,kronecker(-7,.)) = 1, we have: h(-7*1^2) = a(1) = 1, h(-7*2^2) = a(2) = 1, h(-7*3^2) = a(3) = 4, h(-7*4^2) = a(4) = 2, ...
MATHEMATICA
f[p_, e_] := p^(e-1)*(p - KroneckerSymbol[-7, p]); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, May 07 2026 *)
PROG
(PARI) a(n, {d=-7}) = my(f=factor(n)[, 1]~, w=#f); n * prod(i=1, w, 1 - kronecker(d, f[i])/f[i])
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Jianing Song, May 05 2026
STATUS
approved
