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.

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

A194920 a(n) = n - floor(n/sqrt(2)).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22, 22, 22, 23
Offset: 1

Views

Author

Clark Kimberling, Sep 08 2011

Keywords

Comments

a(n) is the number of zeros in row n+1 in triangle A255195. - Mats Granvik, Feb 18 2015.

Crossrefs

Cf. A194921.

Programs

  • Magma
    [n-Floor(n/Sqrt(2)): n in [1..80] ]; // Vincenzo Librandi, Sep 10 2011
    
  • Mathematica
    r = Sqrt[2]; p[n_] := n - Floor[n/r]
    Table[p[n], {n, 1, 90}]  (* A194920 *)
    g[1] = {1}; g[n_] := Insert[g[n - 1], n, p[n]]
    f[1] = g[1]; f[n_] := Join[f[n - 1], g[n]]
    f[20]  (* A194921 *)
    row[n_] := Position[f[30], n];
    u = TableForm[Table[row[n], {n, 1, 5}]]
    v[n_, k_] := Part[row[n], k];
    w = Flatten[Table[v[k, n - k + 1], {n, 1, 13},
    {k, 1, n}]]  (* A194922 *)
    q[n_] := Position[w, n]; Flatten[Table[q[n],
    {n, 1, 80}]]   (* A195071 *)
  • PARI
    vector(100,n,n-floor(n/sqrt(2))) \\ Derek Orr, Feb 28 2015

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

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 3, 3, 1, 5, 4, 4, 3, 1, 6, 5, 5, 5, 4, 1, 7, 6, 6, 6, 5, 4, 1, 8, 7, 7, 7, 6, 5, 4, 1, 9, 8, 8, 8, 7, 7, 6, 4, 1, 10, 9, 9, 9, 9, 8, 7, 6, 5, 1, 11, 10, 10, 10, 10, 9, 9, 8, 7, 5, 1
Offset: 0

Views

Author

Wolfdieter Lang, Mar 12 2015

Keywords

Comments

This entry is motivated by the proposal A255195 by Mats Granvik.
See the MathWorld link on Gauss's circle problem.
The first quadrant of a square lattice (x, y) with x = n >= 0, y = m >= 0, is considered. The number of lattice points 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, ..., n.
The same numbers occur if x and y are interchanged.
One could also consider the row reversed triangle.
The row sums give R(n) = A000603(n), n >= 0.
The alternating row sums give A255239(n), n >= 0.
The total number of square lattice points covered by a circular disk of radius n is A000328(n) = 4*R(n) - (4*n+3).

Examples

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

Crossrefs

Formula

T(n, m) = 1 + floor(sqrt(n^2 - m^2)), 0 <= m <= n.

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.