OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
László Tóth, Counting solutions of quadratic congruences in several variables revisited, arXiv preprint arXiv:1404.4214 [math.NT], 2014.
László Toth, Counting Solutions of Quadratic Congruences in Several Variables Revisited, J. Int. Seq. 17 (2014), Article 14.11.6.
FORMULA
Conjecture: a(n) = n*Sum_{d|2*n} d^2*mu(2*n/d)/3. - Gionata Neri, Feb 18 2018
From Amiram Eldar, Oct 18 2022: (Start)
Multiplicative with a(p^e) = p^(3*e)*(1-1/p^2) if p > 2, and a(2^e) = 8^e.
Sum_{k=1..n} a(k) ~ c * n^4 + O(n^3), where c = 2/(7*zeta(3)) = 0.237687... (Tóth, 2014). (End)
MAPLE
A208895 := proc(n)
local a, pe, p, nu ;
a := 1 ;
for pe in ifactors(n)[2] do
p := op(1, pe) ;
nu := op(2, pe) ;
if p > 2 then
a := a*p^(3*nu)*(1-1/p^2) ;
else
a := a*8^nu ;
end if;
end do:
a ;
end proc:
seq(A208895(n), n=1..20) ; # R. J. Mathar, Jun 23 2018
MATHEMATICA
a[n_] := Length[Union[Flatten[Table[If[Mod[x^2 + y^2 + z^2 + t^2, n] == 1, {x, y, z, t}], {x, n}, {y, n}, {z, n}, {t, n}], 3]]] - 1; Join[{1}, Table[a[n], {n, 2, 30}]]
f[p_, e_] := p^(3*e) * (1-1/p^2); f[2, e_] := 8^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 50] (* Amiram Eldar, Oct 18 2022 *)
PROG
(PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i, 1] == 2, 8^f[i, 2], f[i, 1]^(3*f[i, 2]) * (1 - 1/f[i, 1]^2))); } \\ Amiram Eldar, Oct 18 2022
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
José María Grau Ribas, Mar 03 2012
STATUS
approved