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!)
A229179 Number of solutions of x^2 + y^2 + z^2 == -1 (mod n) with x, y, and z in 0..n-1. 3
1, 4, 12, 8, 30, 48, 56, 0, 108, 120, 132, 96, 182, 224, 360, 0, 306, 432, 380, 240, 672, 528, 552, 0, 750, 728, 972, 448, 870, 1440, 992, 0, 1584, 1224, 1680, 864, 1406, 1520, 2184, 0, 1722, 2688, 1892, 1056, 3240, 2208, 2256, 0, 2744, 3000, 3672, 1456 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Andrew Howroyd and David A. Corneth, Table of n, a(n) for n = 1..10000 (first 2500 terms from Andrew Howroyd).

L. Toth, Counting Solutions of Quadratic Congruences in Several Variables Revisited, J. Int. Seq. 17 (2014) # 14.11.6.

FORMULA

a(8 * n) = 0; for odd prime p, a(p^k) = p^(2 * k - 1) * (p + 1); a(2) = 4, a(4) = 8. - David A. Corneth, Jun 24 2018

EXAMPLE

As 60 = 4 * 3 * 5, a(60) = a(4) * a(3) * a(5) = 8 * (3 * (3 + 1)) * (5 * (5 + 1)) = 8 * 12 * 30 = 2880. - David A. Corneth, Jun 24 2018

MATHEMATICA

Table[Sum[ If[Mod[a^2 + b^2 + c^2 + 1, n] == 0, 1, 0], {c, 0, n - 1}, {b, 0,  n - 1}, {a, 0, n - 1}], {n, 14}]

PROG

(PARI) a(n)={my(p=Mod(sum(i=0, n-1, x^(i^2 % n)), x^n-1)); polcoeff(lift(p^3), n-1)} \\ Andrew Howroyd, Jun 24 2018

(PARI) first(n) = {my(res = vector(n)); forstep(i = 1, n, 2, f = factor(i); res[i] = 1; for(j = 1, #f~, res[i] *= f[j, 1] * (f[j, 1] + 1) * f[j, 1] ^ ((f[j, 2] - 1) << 1)); res); for(k = 1, 2, forstep(i = 1, n >> k, 2, res[i << k] = res[i] << (k+1))); res} \\ David A. Corneth, Jun 24 2018

CROSSREFS

Cf. A086932, A229180.

Sequence in context: A084415 A156681 A231100 * A273172 A307853 A334768

Adjacent sequences:  A229176 A229177 A229178 * A229180 A229181 A229182

KEYWORD

nonn,easy,mult

AUTHOR

José María Grau Ribas, Sep 29 2013

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 April 20 09:21 EDT 2021. Contains 343125 sequences. (Running on oeis4.)