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 13 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.

A048149 Array T read by diagonals: T(i,j) = number of pairs (h,k) with h^2+k^2 <= i^2+j^2, h>=0, k >= 0.

Original entry on oeis.org

1, 3, 3, 6, 4, 6, 11, 8, 8, 11, 17, 13, 9, 13, 17, 26, 19, 15, 15, 19, 26, 35, 28, 22, 20, 22, 28, 35, 45, 37, 30, 26, 26, 30, 37, 45, 58, 48, 39, 33, 31, 33, 39, 48, 58, 73, 62, 52, 43, 41, 41, 43, 52, 62, 73, 90, 75, 64, 54, 50, 48, 50, 54, 64, 75, 90
Offset: 0

Views

Author

Keywords

Examples

			Seen as a triangle:
[0]  1;
[1]  3,  3;
[2]  6,  4,  6;
[3] 11,  8,  8, 11;
[4] 17, 13,  9, 13, 17;
[5] 26, 19, 15, 15, 19, 26;
[6] 35, 28, 22, 20, 22, 28, 35;
[7] 45, 37, 30, 26, 26, 30, 37, 45;
[8] 58, 48, 39, 33, 31, 33, 39, 48, 58;
[9] 73, 62, 52, 43, 41, 41, 43, 52, 62, 73;
		

Crossrefs

Cf. A000603 (right diagonal).

Programs

  • Maple
    A048149 := proc(n, k) option remember; ## n = 0 .. infinity and k = 0 .. n
        local x, y, radius, nTotal;
        if n >= k then
            radius := floor(sqrt(n^2 + k^2));
            nTotal := 0;
            for x from 0 to radius do
                nTotal := nTotal + floor(sqrt(n^2 + k^2 - x^2)) + 1;
            end do;
            return nTotal;
        else
            return A048149(k, n);
        end if;
    end proc: # Yu-Sheng Chang, Jan 14 2020
  • Mathematica
    t[i_, j_] := Module[{h, k}, Reduce[h^2 + k^2 <= i^2 + j^2 && h >= 0 && k >= 0, {h, k}, Integers] // ToRules // Length[{##}]&]; Table[t[n-k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 26 2013 *)

Extensions

a(55) corrected by Jean-François Alcover, Nov 26 2013
a(55) restored by Yu-Sheng Chang, Jan 14 2020

A036702 a(n)=number of Gaussian integers z=a+bi satisfying |z|<=n, a>=0, 0<=b<=a.

Original entry on oeis.org

1, 2, 4, 7, 10, 15, 20, 25, 32, 40, 49, 57, 66, 78, 89, 102, 114, 128, 142, 158, 175, 190, 209, 227, 245, 267, 288, 310, 331, 354, 379, 402, 429, 455, 483, 512, 538, 569, 597, 631, 663, 693, 727, 761, 798, 834, 868, 906, 943, 983
Offset: 0

Views

Author

Keywords

Comments

Row sums of the irregular triangle A255250. - Wolfdieter Lang, Mar 15 2015

Crossrefs

Programs

  • Maple
    A036702 := proc(n)
            local a,x,y ;
            a := 0 ;
            for x from 0 do
                    if x^2 > n^2 then
                            return a;
                    fi ;
                    for y from 0 to x do
                            if y^2+x^2 <= n^2 then
                                    a := a+1 ;
                            end if;
                    end do;
            end do:
    end proc: # R. J. Mathar, Oct 29 2011
  • Mathematica
    a[n_] := Module[{a, b}, If[n == 0, 1, Reduce[a^2 + b^2 <= n^2 && a >= 0 && 0 <= b <= a, {a, b}, Integers] // Length]];
    a /@ Range[0, 49] (* Jean-François Alcover, Oct 17 2019 *)

Formula

a(n) - A036700(n) = 1+A049472(n). - R. J. Mathar, Oct 29 2011
a(n) = sum(floor(sqrt(n^2 - m^2)) - (m-1), m = 0.. floor(n/sqrt(2))), n >= 0. See A255250. - Wolfdieter Lang, Mar 15 2015

A228233 Number of Gaussian primes of norm less than or equal to n in the first quadrant.

Original entry on oeis.org

0, 1, 5, 7, 9, 11, 17, 21, 23, 27, 35, 37, 41, 47, 49, 55, 63, 69, 77, 83, 91, 97, 103, 109, 119, 127, 133, 143, 151, 159, 169, 179, 187, 199, 209, 219, 227, 237, 245, 251, 265, 279, 287, 301, 311, 323, 335, 351, 367, 377, 385, 401, 419, 431, 441, 455, 469
Offset: 1

Views

Author

Olivier Gérard, Aug 17 2013

Keywords

Comments

Include 2 times the primes (once for the real axis, once for the imaginary axis).
More precisely, a(n) includes all Gaussian primes (with the appropriate norms) on the first quadrant's bounding semi-axes. All such Gaussian primes occur in pairs {p, pi} (one real and one imaginary associate), where p is a classical prime of the form 4m + 3 (so p is in A002145) and p <= n. - Rick L. Shepherd, Jun 16 2017

Crossrefs

Cf. A000603 (number of Gaussian integers in the first quadrant with norm less than or equal to n).
Cf. A062711 (counts the Gaussian primes on only one axis).
Cf. A228232 (this sequence excluding classical primes and pure imaginary primes).
Cf. A002145 (Gaussian primes that are positive integers).

Programs

  • Mathematica
    nn = 100; t = Select[Flatten[Table[a + b*I, {a, 0, nn}, {b, 0, nn}]], PrimeQ[#, GaussianIntegers -> True] &]; t2 = Table[0, {nn}]; Do[f = Ceiling[Abs[i]]; If[f <= nn, t2[[f]]++], {i, t}]; Accumulate[t2] (* T. D. Noe, Aug 19 2013 *)

A255195 Triangle describing the shape of one eighth of the Gauss circle problem.

Original entry on oeis.org

1, 2, 0, 2, 1, 0, 2, 1, 1, 0, 2, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 1, 0, 0, 2, 1, 1, 2, 2, 0, 0, 0, 2, 1, 1, 2, 1, 2, 0, 0, 0, 2, 1, 1, 1, 2, 2, 1, 0, 0, 0, 2, 1, 1, 1, 2, 1, 2, 1, 0, 0, 0, 2, 1, 1, 1, 2, 1, 2, 2, 0, 0, 0, 0, 2, 1, 1, 1, 2, 1, 2, 2, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Mats Granvik, Feb 16 2015

Keywords

Comments

The sum of terms of row n is n.
Total of partial sums in reverse (from right to left) equals one eighth of the Gauss circle problem. Whenever there is the number 2 the border of the circle makes a jump upwards. Predicting where the 2's are would say something about the Gauss circle problem. The number of 2's equals the number of 0's in the same row, and is counted by A194920(n-1).

Examples

			1,
2, 0,
2, 1, 0,
2, 1, 1, 0,
2, 1, 2, 0, 0,
2, 1, 1, 2, 0, 0,
2, 1, 1, 2, 1, 0, 0,
2, 1, 1, 2, 2, 0, 0, 0,
2, 1, 1, 2, 1, 2, 0, 0, 0,
2, 1, 1, 1, 2, 2, 1, 0, 0, 0,
2, 1, 1, 1, 2, 1, 2, 1, 0, 0, 0,
2, 1, 1, 1, 2, 1, 2, 2, 0, 0, 0, 0,
2, 1, 1, 1, 2, 1, 2, 2, 1, 0, 0, 0, 0
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Sum[Table[If[And[If[n^2 + k^2 <= r^2, If[n >= k, 1, 0], 0] == 1, If[(n + 1)^2 + (k + 1)^2 <= r^2, If[n >= k, 1, 0], 0]== 0], 1, 0], {k, 0, r}], {n, 0, r}], {r, 0, 12}]]

Formula

A000603(n) = 2*(Sum_{k=1..n} Sum_{k=1..k} T(n,n-k+1))-ceiling((n-1)/sqrt(2)) for n>1.
A247588(n-1) = (Sum_{k=1..n} Sum_{k=1..k} (T(n,k) - T(n,n-k+1))/2).

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.

A302863 a(n) = [x^(n^2)] (1 + theta_3(x))^n/(2^n*(1 - x)), where theta_3() is the Jacobi theta function.

Original entry on oeis.org

1, 2, 6, 29, 165, 1203, 9763, 83877, 793049, 7903501, 83570177, 933697153, 10905583809, 133352809334, 1695473999478, 22354920990148, 305096197935075, 4296142551821184, 62336908825014452, 930284705538262688, 14255992611680074754, 224065160215526683317, 3607018540134004189466
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 14 2018

Keywords

Comments

a(n) = number of nonnegative solutions to (x_1)^2 + (x_2)^2 + ... + (x_n)^2 <= n^2.

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[(1 + EllipticTheta[3, 0, x])^n/(2^n (1 - x)), {x, 0, n^2}], {n, 0, 22}]
    Table[SeriesCoefficient[1/(1 - x) Sum[x^k^2, {k, 0, n}]^n, {x, 0, n^2}], {n, 0, 22}]

A036695 a(n)=number of Gaussian integers z=a+bi satisfying |z|<=n, b>=0.

Original entry on oeis.org

1, 4, 9, 18, 29, 46, 63, 82, 107, 136, 169, 200, 233, 278, 321, 370, 415, 468, 523, 584, 649, 708, 781, 850, 921, 1006, 1087, 1172, 1255, 1344, 1441, 1532, 1637, 1738, 1847, 1962, 2063, 2184, 2295, 2428, 2553, 2672, 2805, 2938
Offset: 0

Views

Author

Keywords

Comments

Number of ordered pairs of integers (x,y) with x^2 + y^2 <= n^2 and y >= 0. [Reinhard Zumkeller, Jan 23 2012]

Crossrefs

Programs

  • Haskell
    a036695 n = length [(x,y) | x <- [-n..n], y <- [0..n], x^2 + y^2 <= n^2]
    -- Reinhard Zumkeller, Jan 23 2012
  • Mathematica
    a[n_] := (k = 0; Do[If[x^2 + y^2 <= n^2, k++], {x, -n, n}, {y, 0, n}]; k); Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Oct 08 2016 *)

Formula

Partial sums of A036696. - Sean A. Irvine, Nov 22 2020

A349609 Number of solutions to x^2 + y^2 <= n^2, where x, y are positive odd integers.

Original entry on oeis.org

0, 0, 1, 1, 3, 4, 8, 8, 13, 15, 20, 22, 28, 31, 39, 43, 52, 54, 64, 69, 79, 83, 96, 102, 112, 121, 135, 140, 154, 162, 179, 185, 203, 212, 228, 238, 255, 265, 281, 296, 316, 326, 349, 359, 382, 394, 416, 429, 451, 469, 494, 508, 532, 547, 573, 587
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 23 2021

Keywords

Examples

			a(4) = 3 since there are solutions (1,1), (3,1), (1,3).
		

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[EllipticTheta[2, 0, x^4]^2/(4 (1 - x)), {x, 0, n^2}], {n, 0, 55}]

Formula

a(n) = [x^(n^2)] theta_2(x^4)^2 / (4 * (1 - x)).
a(n) = Sum_{k=0..n^2} A290081(k).
a(n) = A053415(n) / 4.
Showing 1-10 of 13 results. Next