login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A155919
Number of squared hypotenuses mod n in three dimensions.
0
1, 2, 3, 4, 5, 6, 7, 7, 9, 10, 11, 12, 13, 14, 15, 14, 17, 18, 19, 20, 21, 22, 23, 21, 25, 26, 27, 28, 29, 30, 31, 27, 33, 34, 35, 36, 37, 38, 39, 35, 41, 42, 43, 44, 45, 46, 47, 42, 49, 50, 51, 52, 53, 54, 55, 49, 57, 58, 59, 60, 61, 62, 63, 54, 65, 66, 67, 68, 69, 70, 71, 63
OFFSET
1,2
COMMENTS
Number of images of the map (x,y,z) -> x^2+y^2+z^2 in Z_n.
MATHEMATICA
(For[v = Table[0, {m, 1, n^3}]; m = 1; i = 0, i < n, i++, For[j = 0, j < n, j++, For[k = 0, k < n, k++, v[[m]] = Mod[i^2 + j^2 + k^2, n]; m = m + 1]]]; Length[Union[v]])
CROSSREFS
Sequence in context: A017862 A265539 A254926 * A265540 A075011 A283001
KEYWORD
mult,nonn
AUTHOR
Steven Finch, Jan 30 2009
STATUS
approved