login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087784 Number of solutions to x^2 + y^2 + z^2 = 1 mod n. 12
1, 4, 6, 24, 30, 24, 42, 96, 54, 120, 110, 144, 182, 168, 180, 384, 306, 216, 342, 720, 252, 440, 506, 576, 750, 728, 486, 1008, 870, 720, 930, 1536, 660, 1224, 1260, 1296, 1406, 1368, 1092, 2880, 1722, 1008, 1806, 2640, 1620, 2024, 2162, 2304, 2058, 3000 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
László Tóth, Counting solutions of quadratic congruences in several variables revisited, arXiv preprint arXiv:1404.4214 [math.NT], 2014.
László Tóth, Counting Solutions of Quadratic Congruences in Several Variables Revisited, Journal of Integer Sequences, 17 (2014), Article 14.11.6.
FORMULA
a(n) = n^2 * (3/2 if 4|n) * Product_{primes p == 1 mod 4 dividing n} (1+1/p) * Product_{primes p == 3 mod 4 dividing n} (1-1/p). - Bjorn Poonen, Dec 09 2003
Sum_{k=1..n} a(k) ~ c * n^3 + O(n^2 * log(n)), where c = 36*G/Pi^4 = 0.338518..., where G is Catalan's constant (A006752) (Tóth, 2014). - Amiram Eldar, Oct 18 2022
MATHEMATICA
Table[With[{f = FactorInteger[n][[All, 1]]}, Apply[Times, Map[1 + 1/# &, Select[f, Mod[#, 4] == 1 &]]] Apply[Times, Map[1 - 1/# &, Select[f, Mod[#, 4] == 3 &]]] (1 + Boole[Divisible[n, 4]]/2) n^2] - Boole[n == 1], {n, 50}] (* Michael De Vlieger, Feb 15 2018 *)
PROG
(PARI) a(n) = {my(f=factor(n)); if ((n % 4), 1, 3/2)*n^2*prod(k=1, #f~, p = f[k, 1]; m = p % 4; if (m==1, 1+1/p, if (m==3, 1-1/p, 1))); } \\ Michel Marcus, Feb 14 2018
CROSSREFS
Sequence in context: A237748 A359863 A326233 * A174197 A071224 A305381
KEYWORD
nonn,mult
AUTHOR
Yuval Dekel (dekelyuval(AT)hotmail.com), Oct 06 2003
EXTENSIONS
More terms from David Wasserman, Jun 17 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 12:44 EDT 2024. Contains 371913 sequences. (Running on oeis4.)