cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A230366 a(n) = Sum_{k=1..floor(n/2)} (k^2 mod n).

This page as a plain text file.
%I A230366 #25 Jun 03 2024 03:48:45
%S A230366 0,1,1,1,5,8,7,6,12,25,22,19,39,42,35,28,68,69,76,65,91,110,92,74,125,
%T A230366 169,144,147,203,190,186,152,242,289,245,201,333,342,286,270,410,413,
%U A230366 430,363,420,460,423,340,490,575,578,585,689,666,605,546,760,841
%N A230366 a(n) = Sum_{k=1..floor(n/2)} (k^2 mod n).
%C A230366 a(26) and a(27) are both squares. Conjecture: the number of n such that a(n) and a(n+1) are both squares is infinite.
%C A230366 a(p = prime) == 0 (mod p) for p > 3.
%t A230366 Table[Sum[Mod[k^2, n], {k, Floor[n/2]}], {n, 100}] (* _T. D. Noe_, Oct 22 2013 *)
%t A230366 Table[Sum[PowerMod[k,2,n],{k,Floor[n/2]}],{n,100}] (* _Harvey P. Dale_, Jul 03 2022 *)
%o A230366 (JavaScript)
%o A230366 for (i=1;i<50;i++) {
%o A230366 c=0;
%o A230366 for (j=1;j<=i/2;j++) c+=(j*j)%i;
%o A230366 document.write(c+", ");
%o A230366 }
%o A230366 (PARI) a(n)=sum(i=1,floor(n/2),(i*i)%n) \\ _Ralf Stephan_, Oct 19 2013
%o A230366 (Python)
%o A230366 def A230366(n): return sum(k**2%n for k in range(1,(n>>1)+1)) # _Chai Wah Wu_, Jun 02 2024
%Y A230366 Cf. A048153.
%K A230366 nonn
%O A230366 1,5
%A A230366 _Jon Perry_, Oct 17 2013