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.

A255239 Alternating row sums of triangle A255238.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 3, 5, 4, 7, 6, 8, 7, 10, 6, 9, 6, 11, 9, 14, 11, 15, 10, 15, 11, 14, 11, 18, 14, 19, 14, 18, 13, 20, 15, 23, 16, 25, 21, 24, 19, 23, 16, 27, 20, 28, 21, 30, 22, 27, 22, 31, 25, 34, 27, 35, 24, 35, 26, 32, 29, 36, 26, 39, 28
Offset: 0

Views

Author

Wolfdieter Lang, Mar 12 2015

Keywords

Comments

See A255238 for a Gauss' circle problem comment and a link.

Crossrefs

Cf. A255238.

Formula

a(n) = sum((-1)^m*T(n, m), m = 0..n), n >= 0, with T(n, m) = A255238(n, m) = 1 + floor(sqrt(n^2 - m^2)).

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

A000603 Number of nonnegative solutions to x^2 + y^2 <= n^2.

Original entry on oeis.org

1, 3, 6, 11, 17, 26, 35, 45, 58, 73, 90, 106, 123, 146, 168, 193, 216, 243, 271, 302, 335, 365, 402, 437, 473, 516, 557, 600, 642, 687, 736, 782, 835, 886, 941, 999, 1050, 1111, 1167, 1234, 1297, 1357, 1424, 1491, 1564, 1636, 1703, 1778, 1852, 1931, 2012, 2095
Offset: 0

Views

Author

Keywords

Comments

Row sums of triangle A255238. - Wolfdieter Lang, Mar 15 2015

References

  • 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=2 of A302998.

Programs

  • Haskell
    a000603 n = length [(x,y) | x <- [0..n], y <- [0..n], x^2 + y^2 <= n^2]
    -- Reinhard Zumkeller, Jan 23 2012
    
  • Mathematica
    Table[cnt = 0; Do[If[x^2 + y^2 <= n^2, cnt++], {x, 0, n}, {y, 0, n}]; cnt, {n, 0, 51}] (* T. D. Noe, Apr 02 2013 *)
    Table[If[n==1,1,2*Sum[Sum[A255195[[n, n - k + 1]], {k, 1, k}], {k, 1, n}] - Ceiling[(n - 1)/Sqrt[2]]],{n,1,52}] (* Mats Granvik, Feb 19 2015 *)
  • PARI
    a(n)=my(n2=n^2);sum(a=0,n,sqrtint(n2-a^2)+1) \\ Charles R Greathouse IV, Apr 03 2013
    
  • Python
    from math import isqrt
    def A000603(n): return (m:=n<<1)+sum(isqrt(k*(m-k)) for k in range(1,n))+1 # Chai Wah Wu, Jul 18 2024

Formula

a(n) = n^2 * Pi/4 + O(n). - Charles R Greathouse IV, Apr 03 2013
a(n) = A001182(n) + 2*n + 1. - R. J. Mathar, Jan 07 2015
a(n) = 2*A026702(n) - (1 + floor(n/sqrt(2))), n >= 0. - Wolfdieter Lang, Mar 15 2015
a(n) = [x^(n^2)] (1 + theta_3(x))^2/(4*(1 - x)), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 15 2018

Extensions

More terms from David W. Wilson, May 22 2000

A255250 Array T(n, m) of numbers of points of a square lattice in the first octant covered by a circular disk of radius n (centered at any lattice point taken as origin) with ordinate y = m.

Original entry on oeis.org

1, 2, 3, 1, 4, 2, 1, 5, 3, 2, 6, 4, 3, 2, 7, 5, 4, 3, 1, 8, 6, 5, 4, 2, 9, 7, 6, 5, 3, 2, 10, 8, 7, 6, 5, 3, 1, 11, 9, 8, 7, 6, 4, 3, 1, 12, 10, 9, 8, 7, 5, 4, 2, 13, 11, 10, 9, 8, 6, 5, 3, 1, 14, 12, 11, 10, 9, 8, 6, 4, 3, 1, 15, 13, 12, 11, 10, 9, 7, 6, 4, 2, 16, 14, 13, 12, 11, 10, 8, 7, 5, 4, 2
Offset: 0

Views

Author

Wolfdieter Lang, Mar 14 2015

Keywords

Comments

The row length of this array (irregular triangle) is 1 + flpoor(n/sqrt(2)) = 1 + A049472(n) = 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 10, 11, ...
This entry is motivated by the proposal A255195 by Mats Granvik, who gave the first differences of this array.
See the MathWorld link on Gauss's circle problem.
The first octant of a square lattice (x, y) with n = x >= y = m >= 0 is considered. The number of lattice points in this octant covered by a circular disk of radius R = n around the origin having ordinate value y = m are denoted by T(n, m), for n >= 0 and m = 0, 1, ..., floor(n/sqrt(2)).
The row sums give RS(n) = A036702(n), n >= 0. This is the total number of square lattice points in the first octant covered by a circular disk of radius R = n.
The alternating row sums give A256094(n), n >= 0.
The total number of square lattice points in the first quadrant covered by a circular disk of radius R = n is therefore 2*RS(n) - (1 + floor(n/sqrt(2))) = A000603(n).

Examples

			The array (irregular triangle) T(n, m) begins:
n\m  0  1  2  3  4  5 6 7 8 9 10 ....
0:   1
1:   2
2:   3  1
3:   4  2  1
4:   5  3  2
5:   6  4  3  2
6:   7  5  4  3  1
7:   8  6  5  4  2
8:   9  7  6  5  3  2
9:  10  8  7  6  5  3 1
10: 11  9  8  7  6  4 3 1
11: 12 10  9  8  7  5 4 2
12: 13 11 10  9  8  6 5 3 1
13: 14 12 11 10  9  8 6 4 3 1
14: 15 13 12 11 10  9 7 6 4 2
15: 16 14 13 12 11 10 8 7 5 4  2
...
		

Crossrefs

Formula

T(n, m) = floor(sqrt(n^2 - m^2)) - (m-1), n >= 0, m = 0, 1, ..., floor(n/sqrt(2)).
Showing 1-4 of 4 results.