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.

Showing 1-4 of 4 results.

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

Original entry on oeis.org

1, 2, 4, 7, 9, 13, 18, 24, 29, 34, 42, 51, 57, 67, 78, 90, 97, 110, 122, 137, 149, 163, 180, 198, 211, 226, 246, 265, 281, 303, 324, 348, 365, 386, 412, 439, 457, 483, 512, 540, 561, 590, 618, 651, 679, 709, 742
Offset: 1

Views

Author

Keywords

Examples

			Row sums of the underlying triangle of floor(k^2/n), 1<=k<=n:
1;
0,2;
0,1,3;
0,1,2,4;
0,0,1,3,5;
0,0,1,2,4,6;
0,0,1,2,3,5,7;
0,0,1,2,3,4,6,8;
0,0,1,1,2,4,5,7,9;
0,0,0,1,2,3,4,6,8,10;
- _R. J. Mathar_, Aug 09 2013
		

References

  • M. Eichler and D. Zagier, The Theory of Jacobi Forms, Birkhauser, 1985, p. 103.

Crossrefs

Programs

Formula

a(n) = n +A166375(n).
For prime p>2, a(p) = (p^2+2)/3 - A228131(p)/p. In particular, for prime p==1 (mod 4), a(p) = (p^2+2)/3. - Max Alekseyev, Aug 11 2013

A255643 Difference between sums of quadratic residues and non-residues modulo n that are coprime to n.

Original entry on oeis.org

0, 1, -1, -2, 0, -4, -7, -14, -3, 0, -11, -22, 0, 0, -50, -44, 0, -12, -19, -60, -84, -44, -69, -94, 0, 0, -9, -98, 0, -80, -93, -152, -176, 0, -280, -138, 0, -76, -312, -300, 0, -126, -43, -286, -330, 0, -235, -332, -49, 0, -476, -364, 0, -36, -660, -602, -570, 0, -177, -380, 0, 0, -630, -560, -780, -374, -67, -680, -782, -560, -497, -714, 0, 0, -850, -798, -1232, -468, -395, -1080, -27, 0, -249, -882, -1360, -172, -1508, -1430, 0, -600, -1820, -1058, -1674, 0, -2090, -1240, 0, 0, -1518, -1100
Offset: 1

Views

Author

Max Alekseyev, Mar 01 2015

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local t;
      add(`if`(igcd(t,n)=1, t*numtheory:-quadres(t,n),0), t=1..n-1)
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 27 2025
  • PARI
    { A255643(n) = my(r); r=0; for(i=0,n-1, if(gcd(i,n)>1,next); if(issquare(Mod(i,n)), r+=i, r-=i) ); r }

Formula

For prime n, a(n) = A228131(n) = A255644(n).
For prime n==1 (mod 4), a(n) = 0.
For prime n==3 (mod 4) and n > 3, i.e., n=A002145(m) for m > 1, a(n) = -n*A002143(m).
Is 2 the only n for which a(n) > 0? - Robert Israel, Feb 27 2025

A255644 Difference between sums of quadratic residues and non-residues modulo n (residues are not necessarily coprime to n).

Original entry on oeis.org

0, 1, -1, -4, 0, 1, -7, -18, -12, 5, -11, -38, 0, -7, -45, -92, 0, -33, -19, -120, -70, -11, -69, -192, -50, 13, -99, -210, 0, -135, -93, -352, -198, 17, -245, -438, 0, -19, -325, -510, 0, -245, -43, -550, -540, -115, -235, -880, -196, -175, -459, -728, 0, -333, -715, -1036, -532, 29, -177, -1230, 0, -155, -1155, -1440, -780, -693, -67, -1292, -966, -875, -497, -1908, 0, 37, -1325, -1558, -1232, -1079, -395, -2500, -864, 41, -249, -2366, -1360, -43, -1479, -2552, 0, -2025, -1729, -2346, -1426, -423, -2185, -3568, 0, -637, -2673, -3000
Offset: 1

Views

Author

Max Alekseyev, Mar 01 2015

Keywords

Crossrefs

Programs

  • PARI
    { A255643(n) = my(r); r=0; for(i=0,n-1, if(issquare(Mod(i,n)), r+=i, r-=i) ); r }

Formula

For prime n, a(n) = A228131(n) = A255643(n).
For prime n==1 (mod 4), a(n) = 0.
For prime n==3 (mod 4) and n > 3, i.e., n=A002145(m) for m > 1, a(n) = -n*A002143(m).

A232597 a(n) = sum of odd k in 1..n for which Kronecker(k,n)=1.

Original entry on oeis.org

1, 1, 1, 4, 1, 6, 1, 8, 13, 13, 18, 8, 13, 31, 1, 64, 38, 25, 50, 40, 23, 78, 26, 24, 124, 131, 65, 84, 83, 94, 66, 128, 103, 158, 143, 216, 137, 212, 42, 160, 224, 156, 242, 176, 132, 327, 147, 176, 513, 297, 259, 312, 303, 246, 170, 224, 303, 365, 509, 240
Offset: 1

Views

Author

Antti Karttunen, Nov 26 2013

Keywords

Crossrefs

Restricted to primes: A232505(n) = a(A000040(n)). Cf. also A228131.

Programs

  • Maple
    A232597 := proc(n)
        local a;
        a := 0 ;
        for k from 1 to n by 2 do
            if numtheory[jacobi](k,n) = 1 then
                a := a+k ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, May 25 2017
  • PARI
    A232597(n) = {s=0; for(k=1, n, s=s+((k%2)*((1+kronecker(k, n))\2)*k)); return(s); }
    for(n=1, 60, print1(A232597(n), ", "))
    
  • PARI
    a(n)=my(s); forstep(k=1,n,if(kronecker(k,n)==1, s+=k)); s \\ Charles R Greathouse IV, Nov 26 2013
Showing 1-4 of 4 results.