# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a240547 Showing 1-1 of 1 %I A240547 #43 Oct 18 2022 07:27:22 %S A240547 1,8,33,32,145,264,385,128,945,1160,1441,1056,2353,3080,4785,512,5185, %T A240547 7560,7201,4640,12705,11528,12673,4224,18625,18824,26001,12320,25201, %U A240547 38280,30721,2048,47553,41480,55825,30240,51985,57608,77649,18560,70561,101640 %N A240547 Number of non-congruent solutions of x^2 + y^2 + z^2 + t^2 == 0 mod n. %H A240547 David A. Corneth, Table of n, a(n) for n = 1..10000 %H A240547 László Tóth, Counting solutions of quadratic congruences in several variables revisited, arXiv preprint arXiv:1404.4214 [math.NT], 2014. %H A240547 László Tóth, Counting Solutions of Quadratic Congruences in Several Variables Revisited, J. Int. Seq. 17 (2014), Article 14.11.6. %H A240547 Index to sequences related to sums of squares. %F A240547 Multiplicative, with a(2^e) = 2^(2e+1) for e>=1, a(p^e) = p^(2e-1)*(p^(e+1)+p^e-1) for p > 2, e>=1. %F A240547 For odd n, a(n) = A069097(n)*n = A020478(n). - _R. J. Mathar_, Jun 23 2018 %F A240547 Sum_{k=1..n} a(k) ~ c * n^4 + O(n^3 * log(n)), where c = 5*Pi^2/(168*zeta(3)) = 0.244362... (Tóth, 2014). - _Amiram Eldar_, Oct 18 2022 %e A240547 For n=2 the a(2)=8 solutions are (0,0,0,0), (1,1,0,0), (1,0,1,0), (1,0,0,1), (0,1,1,0), (0,1,0,1), (0,0,1,1), (1,1,1,1). %p A240547 A240547 := proc(n) local a, x, y, z, t ; a := 0 ; for x from 0 to n-1 do for y %p A240547 from 0 to n-1 do for z from 0 to n-1 do for t from 0 to n-1 do if %p A240547 (x^2+y^2+z^2+t^2) mod n = 0 mod n then a := a+1 ; fi; od; od ; od; od; %p A240547 a ; end proc; %p A240547 # alternative %p A240547 A240547 := proc(n) %p A240547 a := 1; %p A240547 for pe in ifactors(n)[2] do %p A240547 p := op(1,pe) ; %p A240547 e := op(2,pe) ; %p A240547 if p = 2 then %p A240547 a := a*p^(2*e+1) ; %p A240547 else %p A240547 a := a* p^(2*e-1)*(p^(e+1)+p^e-1) ; %p A240547 end if; %p A240547 end do: %p A240547 a ; %p A240547 end proc: %p A240547 seq(A240547(n),n=1..100) ; # _R. J. Mathar_, Jun 25 2018 %t A240547 b[2, e_] := 2^(2 e + 1); %t A240547 b[p_, e_] := p^(2 e - 1)*(p^(e + 1) + p^e - 1); %t A240547 a[n_] := Times @@ b @@@ FactorInteger[n]; %t A240547 Array[a, 42] (* _Jean-François Alcover_, Dec 05 2017 *) %o A240547 (PARI) a(n) = my(m); if( n<1, 0, forvec( v = vector(4, i, [0, n-1]), m += (0 == norml2(v)%n))); m /* _Michael Somos_, Apr 07 2014 */ %o A240547 (PARI) a(n) = {my(f = factor(n), res = 1, start = 1, p, e, i); if(n % 2 == 0, res = 1<<(f[1,2]<<1+1); start = 2); for(i = start, #f~, p = f[i, 1]; e = f[i, 2]; res*=(p^(e<<1-1)*(p^(e+1)+p^e-1))); res} \\ _David A. Corneth_, Jul 22 2018 %Y A240547 Cf. A020478, A069097, A086933, A087687, A208895, A229179. %K A240547 nonn,mult %O A240547 1,2 %A A240547 _Laszlo Toth_, Apr 07 2014 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE