The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A048153 a(n) = Sum_{k=1..n} (k^2 mod n). 13
0, 1, 2, 2, 10, 13, 14, 12, 24, 45, 44, 38, 78, 77, 70, 56, 136, 129, 152, 130, 182, 209, 184, 148, 250, 325, 288, 294, 406, 365, 372, 304, 484, 561, 490, 402, 666, 665, 572, 540, 820, 805, 860, 726, 840, 897, 846, 680, 980, 1125, 1156, 1170, 1378, 1305, 1210 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
See A048152 for the array T[n,k] = k^2 mod n.
Starting with a(2)=1 each 4th term is odd: a(n=2+4*k) = 1, 13, 45, 77, 129, 209, 325, 365, ... - Zak Seidov, Apr 22 2009
Positions of squares in A048153: 1, 2, 33, 51, 69, 105, 195, 250, 294, 1250, 4913, 9583, 13778, 48778, 65603, 83521.
Corresponding values of squares are: {0, 1, 22, 34, 46, 70, 130, 175, 203, 875, 3468, 6734, 9711, 34481, 46308, 58956}^2 = {0, 1, 484, 1156, 2116, 4900, 16900, 30625, 41209, 765625, 12027024, 45346756, 94303521, 1188939361, 2144430864, 3475809936}. - Zak Seidov, Nov 02 2011
For n > 1 also row sums of A060036. - Reinhard Zumkeller, Apr 29 2013
LINKS
FORMULA
a(n) == n*(n+1)*(2n+1)/6 (mod n). - Charles R Greathouse IV, Dec 28 2011
a(n) == n*(n-1)*(2n-1)/6 (mod n). - Chai Wah Wu, Jun 02 2024
a(n) mod n = A215573(n). - Alois P. Heinz, Jun 03 2024
EXAMPLE
a(5) = 1^2 + 2^2 + (3^2 mod 5) + (4^2 mod 5) + (5^2 mod 5) = 1 + 4 + 4 + 1 + 0 = 10. (It is easily seen that the last term, n^2 mod n, is always zero and would not need to be included.) - M. F. Hasler, Oct 21 2013
MATHEMATICA
Table[Sum[PowerMod[k, 2, n], {k, n-1}], {n, 1, 10000}] (* Zak Seidov, Nov 02 2011 *)
PROG
(Haskell)
a048153 = sum . a048152_row -- Reinhard Zumkeller, Apr 29 2013
(PARI) a(n)=sum(k=1, n, k^2%n) \\ Charles R Greathouse IV, Oct 21 2013
(Python)
def A048153(n): return sum(k**2%n for k in range(1, n)) # Chai Wah Wu, Jun 02 2024
CROSSREFS
Sequence in context: A066965 A066966 A132443 * A015623 A164124 A003609
KEYWORD
nonn,changed
AUTHOR
EXTENSIONS
Definition made more explicit by M. F. Hasler, Oct 21 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 13 09:03 EDT 2024. Contains 373383 sequences. (Running on oeis4.)