login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Michael De Vlieger, Table of n, a(n) for n = 1..10000

L. Tóth, Counting solutions of quadratic congruences in several variables revisited, arXiv preprint arXiv:1404.4214 [math.NT], 2014.

L. 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

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

Cf. A060968, A087687, A208895, A264083.

Sequence in context: A123046 A237748 A326233 * A174197 A071224 A305381

Adjacent sequences:  A087781 A087782 A087783 * A087785 A087786 A087787

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 8 11:31 EDT 2020. Contains 336298 sequences. (Running on oeis4.)