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-10 of 21 results. Next

A057655 The circle problem: number of points (x,y) in square lattice with x^2 + y^2 <= n.

Original entry on oeis.org

1, 5, 9, 9, 13, 21, 21, 21, 25, 29, 37, 37, 37, 45, 45, 45, 49, 57, 61, 61, 69, 69, 69, 69, 69, 81, 89, 89, 89, 97, 97, 97, 101, 101, 109, 109, 113, 121, 121, 121, 129, 137, 137, 137, 137, 145, 145, 145, 145, 149, 161, 161, 169, 177, 177, 177
Offset: 0

Views

Author

N. J. A. Sloane, Oct 15 2000

Keywords

Examples

			a(0) = 1 (counting origin).
a(1) = 5 since 4 points lie on the circle of radius sqrt(1) + origin.
a(2) = 9 since 4 lattice points lie on the circle w/radius = sqrt(2) (along diagonals) + 4 points inside the circle + origin. - _Wesley Ivan Hurt_, Jan 10 2013
		

References

  • C. Alsina and R. B. Nelsen, Charming Proofs: A Journey Into Elegant Mathematics, Math. Assoc. Amer., 2010, p. 42.
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • F. Fricker, Einfuehrung in die Gitterpunktlehre, Birkhäuser, Boston, 1982.
  • P. de la Harpe, Topics in Geometric Group Theory, Univ. Chicago Press, 2000, p. 5.
  • E. Kraetzel, Lattice Points, Kluwer, Dordrecht, 1988.
  • C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 51.
  • W. Sierpiński, Elementary Theory of Numbers, Elsevier, North-Holland, 1988.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 245-246.

Crossrefs

Partial sums of A004018. Cf. A014198, A057656, A057961, A057962, A122510. For another version see A000328.
Cf. A038589 (for hexagonal lattice).

Programs

  • Haskell
    a057655 n = length [(x,y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 <= n]
    -- Reinhard Zumkeller, Jan 23 2012
    
  • Maple
    N:= 1000: # to get a(0) to a(N)
    R:= Array(0..N):
    for a from 0 to floor(sqrt(N)) do
      for b from 0 to floor(sqrt(N-a^2)) do
        r:= a^2 + b^2;
        R[r]:= R[r] + (2 - charfcn[0](a))*(2 - charfcn[0](b));
      od
    od:
    convert(map(round,Statistics:-CumulativeSum(R)),list); # Robert Israel, Sep 29 2014
  • Mathematica
    f[n_] := 1 + 4Sum[ Floor@ Sqrt[n - k^2], {k, 0, Sqrt[n]}]; Table[ f[n], {n, 0, 60}] (* Robert G. Wilson v, Jun 16 2006 *)
    Accumulate[ SquaresR[2, Range[0, 55]]] (* Jean-François Alcover, Feb 24 2012 *)
    CoefficientList[Series[EllipticTheta[3,0,x]^2/(1-x), {x, 0, 100}], x] (* Vaclav Kotesovec, Sep 29 2014 after Robert Israel *)
  • PARI
    a(n)=sum(x=-n,n,sum(y=-n,n,if((sign(x^2+y^2-n)+1)*sign(x^2+y^2-n),0,1)))
    
  • PARI
    a(n)=1+4*sum(k=0,sqrtint(n), sqrtint(n-k^2) ); /* Benoit Cloitre, Oct 08 2012 */
    
  • Python
    from math import isqrt
    def A057655(n): return 1+(sum(isqrt(n-k**2) for k in range(isqrt(n)+1))<<2) # Chai Wah Wu, Jul 31 2023

Formula

a(n) = 1 + 4*{ [n/1] - [n/3] + [n/5] - [n/7] + ... }. - Gauss
a(n) = 1 + 4*Sum_{ k = 0 .. [sqrt(n)] } [ sqrt(n-k^2) ]. - Liouville (?)
a(n) - Pi*n = O(sqrt(n)) (Gauss). a(n) - Pi*n = O(n^c), c = 23/73 + epsilon ~ 0.3151 (Huxley). If a(n) - Pi*n = O(n^c) then c > 1/4 (Landau, Hardy). It is conjectured that a(n) - Pi*n = O(n^(1/4 + epsilon)) for all epsilon > 0.
a(n) = A014198(n) + 1.
a(n) = A122510(2,n). - R. J. Mathar, Apr 21 2010
a(n) = 1 + sum((floor(1/(k+1)) + 4 * floor(cos(Pi * sqrt(k))^2) - 4 * floor(cos(Pi * sqrt(k/2))^2) + 8 * sum((floor(cos(Pi * sqrt(i))^2) * floor(cos(Pi * sqrt(k-i))^2)), i = 1..floor(k/2))), k = 1..n). - Wesley Ivan Hurt, Jan 10 2013
G.f.: theta_3(0,x)^2/(1-x) where theta_3 is a Jacobi theta function. - Robert Israel, Sep 29 2014
a(n^2) = A000328(n). - R. J. Mathar, Aug 03 2025

A117609 Number of lattice points inside the ball x^2 + y^2 + z^2 <= n.

Original entry on oeis.org

1, 7, 19, 27, 33, 57, 81, 81, 93, 123, 147, 171, 179, 203, 251, 251, 257, 305, 341, 365, 389, 437, 461, 461, 485, 515, 587, 619, 619, 691, 739, 739, 751, 799, 847, 895, 925, 949, 1021, 1021, 1045, 1141, 1189, 1213, 1237, 1309, 1357, 1357, 1365, 1419, 1503
Offset: 0

Views

Author

John L. Drost, Apr 06 2006

Keywords

Examples

			a(2) = 1 + 6 + 12 = 19, since (0,0,0) and (0, 0, +-1) and cyclic permutations (for a total of 6 points), and +-(0, 1, +-1) and cyclic permutations (for a total 12 points) are inside or on x^2 + y^2 + z^2 = 2.
		

Crossrefs

Partial sums of A005875.
Cf. A000605 (number of points of norm <= n in cubic lattice).
Cf. A210639, A000092 and references therein.
Cf. A057655.

Programs

  • Mathematica
    Table[Sum[SquaresR[3,k], {k,0,n}], {n,0,50}] (* T. D. Noe, Apr 08 2006, revised Sep 27 2011 *)
  • PARI
    A117609(n)=sum(x=0,sqrtint(n),(sum(y=1,sqrtint(t=n-x^2),1+2*sqrtint(t-y^2))*2+sqrtint(t)*2+1)*2^(x>0)) \\ M. F. Hasler, Mar 26 2012
    
  • PARI
    q='q+O('q^66); Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^3/(1-q)) /* Joerg Arndt, Apr 08 2013 */
    
  • Python
    # uses Python code for A057655
    from math import isqrt
    def A117609(n): return A057655(n)+(sum(A057655(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 23 2024

Formula

a(n) ~ (4/3)*Pi*n^(3/2) ~ A210639(n).
a(n) = A122510(3,n). - R. J. Mathar, Apr 21 2010
G.f.: T3(q)^3/(1-q) where T3(q) = 1 + 2*Sum_{k>=1} q^(k^2). - Joerg Arndt, Apr 08 2013
a(n^2) = A000605(n). - R. J. Mathar, Aug 03 2025

A302998 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals: A(n,k) = [x^(n^2)] (1 + theta_3(x))^k/(2^k*(1 - x)), where theta_3() is the Jacobi theta function.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 11, 11, 5, 1, 1, 6, 20, 29, 17, 6, 1, 1, 7, 36, 70, 54, 26, 7, 1, 1, 8, 63, 157, 165, 99, 35, 8, 1, 1, 9, 106, 337, 482, 357, 163, 45, 9, 1, 1, 10, 171, 702, 1319, 1203, 688, 239, 58, 10, 1, 1, 11, 265, 1420, 3390, 3819, 2673, 1154, 344, 73, 11, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 17 2018

Keywords

Comments

A(n,k) is the number of nonnegative solutions to (x_1)^2 + (x_2)^2 + ... + (x_k)^2 <= n^2.

Examples

			Square array begins:
  1,  1,   1,   1,    1,     1,  ...
  1,  2,   3,   4,    5,     6,  ...
  1,  3,   6,  11,   20,    36,  ...
  1,  4,  11,  29,   70,   157,  ...
  1,  5,  17,  54,  165,   482,  ...
  1,  6,  26,  99,  357,  1203,  ...
		

Crossrefs

Programs

  • Mathematica
    Table[Function[k, SeriesCoefficient[(1 + EllipticTheta[3, 0, x])^k/(2^k (1 - x)), {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
    Table[Function[k, SeriesCoefficient[1/(1 - x) Sum[x^i^2, {i, 0, n}]^k, {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
  • PARI
    T(n,k)={if(k==0, 1, polcoef(((sum(j=0, n, x^(j^2)) + O(x*x^(n^2)))^k)/(1-x), n^2))} \\ Andrew Howroyd, Sep 14 2019

Formula

A(n,k) = [x^(n^2)] (1/(1 - x))*(Sum_{j>=0} x^(j^2))^k.

A302997 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals: A(n,k) = [x^(n^2)] theta_3(x)^k/(1 - x), where theta_3() is the Jacobi theta function.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 5, 5, 1, 1, 7, 13, 7, 1, 1, 9, 33, 29, 9, 1, 1, 11, 89, 123, 49, 11, 1, 1, 13, 221, 425, 257, 81, 13, 1, 1, 15, 485, 1343, 1281, 515, 113, 15, 1, 1, 17, 953, 4197, 5913, 3121, 925, 149, 17, 1, 1, 19, 1713, 12435, 23793, 16875, 6577, 1419, 197, 19, 1, 1, 21, 2869, 33809, 88273, 84769, 42205, 11833, 2109, 253, 21, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 17 2018

Keywords

Comments

A(n,k) is the number of integer lattice points inside the k-dimensional hypersphere of radius n.

Examples

			Square array begins:
  1,   1,   1,    1,     1,      1,  ...
  1,   3,   5,    7,     9,     11,  ...
  1,   5,  13,   33,    89,    221,  ...
  1,   7,  29,  123,   425,   1343,  ...
  1,   9,  49,  257,  1281,   5913,  ...
  1,  11,  81,  515,  3121,  16875,  ...
		

Crossrefs

Programs

  • Mathematica
    Table[Function[k, SeriesCoefficient[EllipticTheta[3, 0, x]^k/(1 - x), {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
    Table[Function[k, SeriesCoefficient[1/(1 - x) Sum[x^i^2, {i, -n, n}]^k, {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
  • PARI
    T(n,k)={if(k==0, 1, polcoef(((1 + 2*sum(j=1, n, x^(j^2)) + O(x*x^(n^2)))^k)/(1-x), n^2))} \\ Andrew Howroyd, Sep 14 2019

Formula

A(n,k) = [x^(n^2)] (1/(1 - x))*(Sum_{j=-infinity..infinity} x^(j^2))^k.

A046895 Sizes of successive clusters in Z^4 lattice.

Original entry on oeis.org

1, 9, 33, 65, 89, 137, 233, 297, 321, 425, 569, 665, 761, 873, 1065, 1257, 1281, 1425, 1737, 1897, 2041, 2297, 2585, 2777, 2873, 3121, 3457, 3777, 3969, 4209, 4785, 5041, 5065, 5449, 5881, 6265, 6577, 6881, 7361, 7809, 7953, 8289, 9057
Offset: 0

Views

Author

Keywords

Comments

Number of lattice points inside or on the 4-sphere x^2 + y^2 + z^2 + u^2 = n. - T. D. Noe, Mar 14 2009

Crossrefs

Partial sums of A000118.

Programs

  • Mathematica
    Accumulate[ Table[ SquaresR[4, n], {n, 0, 42}]] (* Jean-François Alcover, May 11 2012 *)
    QP = QPochhammer; s = (QP[q^2]^5/(QP[q]^2*QP[q^4]^2))^4/(1-q) + O[q]^50; CoefficientList[s, q] (* Jean-François Alcover, Nov 25 2015, after Joerg Arndt *)
  • PARI
    q='q+O('q^66);
    Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^4/(1-q))
    /* Joerg Arndt, Apr 08 2013 */
    
  • Python
    from math import isqrt
    def A046895(n): return 1+((-(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))&-1)<<2)+(((t:=isqrt(m:=n>>2))**2*(t+1)-sum((q:=m//k)*((k<<1)+q+1) for k in range(1,t+1))&-1)<<4) # Chai Wah Wu, Jun 21 2024

Formula

a(n) = A122510(4,n). a(n^2) = A055410(n). - R. J. Mathar, Apr 21 2010
G.f.: T3(q)^4/(1-q) where T3(q) = 1 + 2*Sum_{k>=1} q^(k^2). - Joerg Arndt, Apr 08 2013
Pi^2/2 * (sqrt(n)-1)^4 < a(n) < Pi^2/2 * (sqrt(n)+1)^4 for n > 0. - Charles R Greathouse IV, Feb 17 2015
a(n) = Pi^2/2 * n^2 + O(n (log n)^(2/3)) using a result of Walfisz. - Charles R Greathouse IV, Feb 18 2015
a(n) = 1 + 8*A024916(n) - 32*A024916(floor(n/4)) by Jacobi's four-square theorem. - Peter J. Taylor, Jun 03 2020

A175361 Partial sums of A000141.

Original entry on oeis.org

1, 13, 73, 233, 485, 797, 1341, 2301, 3321, 4197, 5757, 8157, 10237, 12277, 15541, 19701, 23793, 27273, 31653, 38853, 45405, 50013, 58173, 68733, 76957, 84769, 94969, 108089, 120569, 130673, 144817, 164017, 180397, 191917, 209317, 234277, 252673, 269113, 293593
Offset: 0

Views

Author

R. J. Mathar, Apr 24 2010

Keywords

Comments

The 6th row of A122510.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[EllipticTheta[3,x]^6/(1-x),{x,0,35}],x] (* Stefano Spezia, Jun 21 2024 *)
  • Python
    from math import prod
    from sympy import factorint
    def A175361(n):
        c = 1
        for m in range(1,n+1):
            f = [(p,e,(0,1,0,-1)[p&3]) for p,e in factorint(m).items()]
            c += (prod((p**(e+1<<1)-a)//(p**2-a) for p, e, a in f)<<2)-prod(((k:=p**2*a)**(e+1)-1)//(k-1) for p, e, a in f)<<2
        return c # Chai Wah Wu, Jun 21 2024

Formula

a(n^2) = A055412(n).
G.f.: theta_3(x)^6 / (1 - x). - Ilya Gutkovskiy, Feb 13 2021

A175360 Partial sums of A000132.

Original entry on oeis.org

1, 11, 51, 131, 221, 333, 573, 893, 1093, 1343, 1903, 2463, 2863, 3423, 4223, 5183, 5913, 6393, 7633, 9153, 9905, 11025, 12865, 14465, 15665, 16875, 18875, 21115, 22715, 24395, 27115, 30315, 31795, 33235, 36915, 39955, 42205, 45005, 48285
Offset: 0

Views

Author

R. J. Mathar, Apr 24 2010

Keywords

Comments

The 5th row of A122510.

Crossrefs

Programs

Formula

a(n^2) = A055411(n).
G.f.: theta_3(x)^5 / (1 - x). - Ilya Gutkovskiy, Feb 13 2021

A055411 Number of points in Z^5 of norm <= n.

Original entry on oeis.org

1, 11, 221, 1343, 5913, 16875, 42205, 89527, 176377, 313259, 532509, 853399, 1322921, 1961211, 2846933, 4005143, 5554265, 7491355, 9977557, 13065527, 16907817, 21524019, 27179909, 33921671, 42036401, 51452803, 62664773
Offset: 0

Views

Author

Keywords

Crossrefs

Column k=5 of A302997.
Cf. A122510.

Programs

Formula

a(n) = A122510(5,n^2). - R. J. Mathar, Apr 21 2010
a(n) = [x^(n^2)] theta_3(x)^5/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018

A341397 Number of integer solutions to (x_1)^2 + (x_2)^2 + ... + (x_8)^2 <= n.

Original entry on oeis.org

1, 17, 129, 577, 1713, 3729, 6865, 12369, 21697, 33809, 47921, 69233, 101041, 136209, 174737, 231185, 306049, 384673, 469457, 579217, 722353, 876465, 1025649, 1220337, 1481521, 1733537, 1979713, 2306753, 2697537, 3087777, 3482913, 3959585, 4558737, 5155473
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 10 2021

Keywords

Comments

Partial sums of A000143.

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n=0, 1, `if`(n<0 or k<1, 0,
          b(n, k-1)+2*add(b(n-j^2, k-1), j=1..isqrt(n))))
        end:
    a:= proc(n) option remember; b(n, 8)+`if`(n>0, a(n-1), 0) end:
    seq(a(n), n=0..33);  # Alois P. Heinz, Feb 10 2021
  • Mathematica
    nmax = 33; CoefficientList[Series[EllipticTheta[3, 0, x]^8/(1 - x), {x, 0, nmax}], x]
    Table[SquaresR[8, n], {n, 0, 33}] // Accumulate
  • Python
    from math import prod
    from sympy import factorint
    def A341397(n): return (sum((prod((p**(3*(e+1))-(1 if p&1 else 15))//(p**3-1) for p, e in factorint(m).items()) for m in range(1,n+1)))<<4)+1 # Chai Wah Wu, Jun 21 2024

Formula

G.f.: theta_3(x)^8 / (1 - x).
a(n^2) = A055414(n).

A055412 Number of points in Z^6 of norm <= n.

Original entry on oeis.org

1, 13, 485, 4197, 23793, 84769, 252673, 622573, 1395261, 2787125, 5260181, 9249417, 15637897, 25112577, 39258381, 59174749, 87380293, 125264525, 176663297, 244000537, 332379769, 444344469, 587923621, 766764301, 990981473
Offset: 0

Views

Author

Keywords

Crossrefs

Column k=6 of A302997.
Cf. A122510.

Programs

  • Mathematica
    t[d_, n_] := t[d, n] = t[d, n - 1] + SquaresR[d, n]; t[d_, 0] = 1;
    a[n_] := t[6, n^2];
    a /@ Range[0, 100] (* Jean-François Alcover, Sep 27 2019, after R. J. Mathar *)
  • Python
    from math import prod
    from sympy import factorint
    def A055412(n):
        c = 1
        for m in range(1,n**2+1):
            f = [(p,e,(0,1,0,-1)[p&3]) for p,e in factorint(m).items()]
            c += (prod((p**(e+1<<1)-a)//(p**2-a) for p, e, a in f)<<2)-prod(((k:=p**2*a)**(e+1)-1)//(k-1) for p, e, a in f)<<2
        return c # Chai Wah Wu, Jun 21 2024

Formula

a(n) = A122510(6,n^2). - R. J. Mathar, Apr 21 2010
a(n) = [x^(n^2)] theta_3(x)^6/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018
Showing 1-10 of 21 results. Next