A316148 Number of non-congruent solutions of x^2+y^2 == z^2+w^2 (mod n).
1, 8, 33, 96, 145, 264, 385, 896, 945, 1160, 1441, 3168, 2353, 3080, 4785, 7680, 5185, 7560, 7201, 13920, 12705, 11528, 12673, 29568, 18625, 18824, 26001, 36960, 25201, 38280, 30721, 63488, 47553, 41480, 55825, 90720, 51985, 57608, 77649, 129920, 70561, 101640, 81313
Offset: 1
Links
Programs
-
Maple
A316148 := proc(n) a := 1; for pe in ifactors(n)[2] do p := op(1,pe) ; e := op(2,pe) ; if p = 2 then a := a*p^(2*e+1)*(p^e-1) ; else a := a*p^(2*e-1)*(p^(e+1)+p^e-1) ; end if; end do: a ; end proc: seq(A316148(n),n=1..100) ;
-
Mathematica
f[2, e_] := 2^(2*e+1)*(2^e-1); f[p_, e_] := p^(3*e)+p^(3*e-1)-p^(2*e-1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 11 2020 *)
-
PARI
a(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i,1]; e = f[i,2]; if(p == 2, 2^(2*e+1)*(2^e-1), p^(3*e)+p^(3*e-1)-p^(2*e-1)));} \\ Amiram Eldar, Dec 18 2023
Formula
Multiplicative with a(2^e) = 2^(2e+1)*(2^e-1), a(p^e) = p^(3e)+p^(3e-1)-p^(2e-1) for odd primes p.
Sum_{k=1..n} a(k) ~ c * n^4 / 4, where c = zeta(2)/zeta(3) = 1.368432... (A306633). - Amiram Eldar, Dec 18 2023