OFFSET
1,16
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..10000
Aung Phone Maw, Certain products of sums of Lambert series, arXiv:2408.01763 [math.GM], 2024 (see Corollary 5).
EXAMPLE
a(8) = 1 since 8 = 1^2 + 7*1^2.
a(11) = 1 since 11 = 2^2 + 7*1^2.
a(88) = 2 since 88 = 9^2 + 7*1^2 = 5^2 + 7*3^2.
MATHEMATICA
r[n_] := Reduce[x >= 0 && y >= 0 && x^2 + 7 y^2 == n, Integers];
a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1];
Table[a[n], {n, 1, 87}] (* Jean-François Alcover, Jun 24 2017 *)
PROG
(PARI) a(n)=sum(i=0, sqrtint(n\7), issquare(n-7*i^2)) \\ Andrew Howroyd, Nov 24 2025
(PARI) \\ solution based on multiplicative A110399.
a(n) = {my(f= factor(n)); (prod(k=1, #f~, my([p, e] = f[k, ]); if( p==2, e-1, p==7, 1, kronecker(-7, p)==-1, (1+(-1)^e)/2, e+1)) + issquare(n) + issquare(7*n))/2 }; \\ Andrew Howroyd, Nov 24 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
V. Raman, Sep 08 2012
STATUS
approved
