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 20 results. Next

A000328 Number of points of norm <= n^2 in square lattice.

Original entry on oeis.org

1, 5, 13, 29, 49, 81, 113, 149, 197, 253, 317, 377, 441, 529, 613, 709, 797, 901, 1009, 1129, 1257, 1373, 1517, 1653, 1793, 1961, 2121, 2289, 2453, 2629, 2821, 3001, 3209, 3409, 3625, 3853, 4053, 4293, 4513, 4777, 5025, 5261, 5525, 5789, 6077, 6361, 6625
Offset: 0

Views

Author

Keywords

Comments

Number of ordered pairs of integers (x,y) with x^2 + y^2 <= n^2.

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • H. Gupta, A Table of Values of N_3(t), Proc. National Institute of Sciences of India, 13 (1947), 35-63.
  • C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 47.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=2 of A302997.
Equals A051132 + A046109. For another version see A057655.

Programs

  • Haskell
    a000328 n = length [(x,y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 <= n^2]
    -- Reinhard Zumkeller, Jan 23 2012
    
  • Mathematica
    Table[Sum[SquaresR[2, k], {k, 0, n^2}], {n, 0, 46}]
  • PARI
    { a(n) = 1 + 4 * sum(j=0,n^2\4, n^2\(4*j+1) - n^2\(4*j+3) ) } /* Max Alekseyev, Nov 18 2007 */
    
  • Python
    def A000328(n):
        return (sum([int((n**2 - y**2)**0.5) for y in range(1, n)]) * 4 + 4*n + 1)
        # Karl-Heinz Hofmann, Aug 03 2022
    
  • Python
    from math import isqrt
    def A000328(n): return 1+(sum(isqrt(k*((n<<1)-k)) for k in range(1,n+1))<<2) # Chai Wah Wu, Feb 12 2025

Formula

a(n) = 1 + 4 * Sum_{j>=0} floor(n^2/(4*j+1)) - floor(n^2/(4*j+3)). Also a(n) = A057655(n^2). - Max Alekseyev, Nov 18 2007
a(n) = 4*A000603(n) - (4*n+3), n >= 0. - Wolfdieter Lang, Mar 15 2015
a(n) = 1+4*n^2-4*ceiling((n-1)/sqrt(2))-8*A247588(n-1), n>1. - Mats Granvik, May 23 2015
a(n) = [x^(n^2)] theta_3(x)^2/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018
Limit_{n->oo} a(n)/n^2 = Pi. - Chai Wah Wu, Feb 12 2025

Extensions

More terms from David W. Wilson, May 22 2000
Edited at the suggestion of Max Alekseyev by N. J. A. Sloane, Nov 18 2007
Incorrect comment removed by Eric M. Schmidt, May 28 2015

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.

A000605 Number of points of norm <= n in cubic lattice.

Original entry on oeis.org

1, 7, 33, 123, 257, 515, 925, 1419, 2109, 3071, 4169, 5575, 7153, 9171, 11513, 14147, 17077, 20479, 24405, 28671, 33401, 38911, 44473, 50883, 57777, 65267, 73525, 82519, 91965, 101943, 113081, 124487, 137065, 150555, 164517, 179579, 195269, 212095
Offset: 0

Views

Author

Keywords

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • H. Gupta, A Table of Values of N_3(t), Proc. National Institute of Sciences of India, 13 (1947), 35-63.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=3 of A302997.
Cf. A117609 (number of lattice points inside the ball x^2+y^2+z^2 <= n).

Programs

  • C
    int A000605(int i)
    {
        const int ring = i*i;
        int result = 0;
        for (int a = -i; a <= i; a++)
            for (int b = -i; b <= i; b++)
                for (int c = -i; c <= i; c++)
                    if ( ring >= a*a+b*b+c*c )  result++;
        return result;
    } /* Oskar Wieland, Apr 08 2013 */
    
  • Mathematica
    Table[Sum[SquaresR[3, k], {k, 0, n^2}], {n, 0, 37}]
  • PARI
    N=66;  q='q+O('q^(N^2));
    t=Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^3/(1-q));  /* A117609 */
    vector(sqrtint(#t),n,t[(n-1)^2+1])
    /* Joerg Arndt, Apr 08 2013 */

Formula

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

Extensions

More terms from David W. Wilson, May 22 2000

A055410 Number of points in Z^4 of norm <= n.

Original entry on oeis.org

1, 9, 89, 425, 1281, 3121, 6577, 11833, 20185, 32633, 49689, 72465, 102353, 140945, 190121, 250553, 323721, 411913, 519025, 643441, 789905, 961721, 1156217, 1380729, 1638241, 1927297, 2257281, 2624417, 3035033, 3490601, 4000425
Offset: 0

Views

Author

Keywords

Crossrefs

Column k=4 of A302997.
Cf. A046895 (sizes of successive clusters in Z^4 lattice).

Programs

  • C
    int A055410(int i)
    {
        const int ring = i*i;
        int result = 0;
        for(int a = -i; a <= i; a++)
            for(int b = -i; b <= i; b++)
                for(int c = -i; c <= i; c++)
                    for(int d = -i; d <= i; d++)
                        if ( ring >= a*a + b*b + c*c + d*d ) result++;
        return result;
    } /* Oskar Wieland, Apr 08 2013 */
    
  • Mathematica
    a[n_] := SeriesCoefficient[EllipticTheta[3, 0, x]^4/(1 - x), {x, 0, n^2}];
    a /@ Range[0, 30] (* Jean-François Alcover, Sep 23 2019, after Ilya Gutkovskiy *)
  • PARI
    N=66;  q='q+O('q^(N^2));
    t=Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^4/(1-q)); /* A046895 */
    vector(sqrtint(#t),n,t[(n-1)^2+1])
    /* Joerg Arndt, Apr 08 2013 */
    
  • Python
    from math import isqrt
    def A055410(n): return 1+((-(s:=n**2)*(n+1)+sum((q:=s//k)*((k<<1)+q+1) for k in range(1,n+1))&-1)<<2)+(((t:=isqrt(m:=s>>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 24 2024

Formula

a(n) = A046895(n^2). - Joerg Arndt, Apr 08 2013
a(n) = [x^(n^2)] theta_3(x)^4/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018

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

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

A055413 Number of points in Z^7 of norm <= n.

Original entry on oeis.org

1, 15, 953, 12435, 88273, 394691, 1405325, 4031123, 10248133, 23120727, 48218513, 93417543, 172039681, 299505299, 503363697, 813950491, 1279144845, 1950568311, 2912136485, 4244109647, 6080556217, 8545686087, 11835454865
Offset: 0

Views

Author

Keywords

Crossrefs

Column k=7 of A302997.

Formula

a(n) = [x^(n^2)] theta_3(x)^7/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018

A055414 Number of points in Z^8 of norm <= n.

Original entry on oeis.org

1, 17, 1713, 33809, 306049, 1733537, 7259297, 24499121, 70554353, 179773681, 415055025, 886597537, 1773617697, 3355533537, 6058457297, 10510672945, 17588781393, 28537047057, 45040906785, 69369596001, 104503770913
Offset: 0

Views

Author

Keywords

Comments

Numbers so far are all 1 mod 16. - Ralf Stephan, Jul 07 2003

Crossrefs

Column k=8 of A302997.

Formula

a(n) = [x^(n^2)] theta_3(x)^8/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018

A055415 Number of points in Z^9 of norm <= n.

Original entry on oeis.org

1, 19, 2869, 84663, 995241, 7129227, 35372141, 140246303, 458690081, 1318315075, 3375505573, 7945596055, 17282877369, 35516896155, 68960061837, 128236319951, 228701936081, 394678200083, 658850300869, 1072056316615
Offset: 0

Views

Author

Keywords

Crossrefs

Column k=9 of A302997.

Formula

a(n) = [x^(n^2)] theta_3(x)^9/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018

A055416 Number of points in Z^10 of norm <= n.

Original entry on oeis.org

1, 21, 4541, 198765, 3083569, 27634481, 164379601, 759891589, 2839094517, 9183188589, 26107328109, 67602028569, 160441685209, 357086356401, 746545031221, 1487788785845, 2829595966381, 5188248484757, 9170828884817
Offset: 0

Views

Author

Keywords

Comments

Here "norm" is being used in the sense of L_2 norm, as opposed to the definition in SPLAG. - N. J. A. Sloane, Sep 29 2007

Examples

			To check that a(2) = 4541:
norm^2 # total
0 1 1
1 20 21
2 180 201
3 960 1161
4 3380 4541
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag.

Crossrefs

Column k=10 of A302997.

Formula

a(n) = [x^(n^2)] theta_3(x)^10/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 15 2018

Extensions

Edited by N. J. A. Sloane, Sep 29 2007
Showing 1-10 of 20 results. Next