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-3 of 3 results.

A232499 Number of unit squares, aligned with a Cartesian grid, completely within the first quadrant of a circle centered at the origin ordered by increasing radius.

Original entry on oeis.org

1, 3, 4, 6, 8, 10, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 33, 35, 37, 39, 41, 45, 47, 48, 50, 52, 54, 56, 60, 62, 64, 66, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 89, 90, 94, 96, 98, 102, 104, 106, 108, 110, 112, 114, 115, 117, 119, 123, 125, 127, 129, 131
Offset: 1

Views

Author

Rajan Murthy and Vale Murthy, Nov 24 2013

Keywords

Comments

The interval between terms reflects the number of ways a square integer can be partitioned into the sum of two square integers in an ordered pair. As examples, the increase from a(1) to a(2) from 1 to 3 is due to the inclusion of (1,2) and (2,1); and the increase from a(2) to a(3) is due to the inclusion of (2,2). Larger intervals occur when there are more combinations, such as, between a(17) and a(18) when (1,7), (7,1), and (5,5) are included.

Examples

			When radius of the circle exceeds 2^(1/2), one square is completely within the circle until the radius reaches 5^(1/2) when three squares are completely within the circle.
		

Crossrefs

First differences are in A229904.
The first differences must be odd at positions given in A024517 by proof by symmetry as r^2=2*n^2 is on the x=y line.
The radii corresponding to the terms are given by the square roots of A000404.
Cf. A237707 (3-dimensional analog), A239353 (4-dimensional analog).

Programs

  • Mathematica
    (* An empirical solution *) terms = 100; f[r_] := Sum[Floor[Sqrt[r^2 - n^2]], {n, 1, Floor[r]}]; Clear[g]; g[m_] := g[m] = Union[Table[f[Sqrt[s]], {s, 2, m }]][[1 ;; terms]]; g[m = dm = 4*terms]; g[m = m + dm]; While[g[m] != g[m - dm], Print[m]; m = m + dm]; A232499 = g[m]  (* Jean-François Alcover, Mar 06 2014 *)

A234300 Number of unit squares, aligned with a Cartesian grid, partially encircled along the edge of the first quadrant of a circle centered at the origin ordered by increasing radius.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 3, 5, 3, 5, 4, 5, 5, 7, 5, 7, 5, 7, 7, 9, 7, 9, 8, 9, 7, 9, 7, 11, 9, 11, 9, 11, 10, 11, 9, 11, 11, 13, 11, 13, 11, 13, 11, 13, 11, 13, 13, 15, 12, 15, 13, 15, 13, 15, 13, 15, 13, 15, 15, 17, 13, 17, 15, 17, 16, 17, 15, 17, 15, 17, 15, 17, 17, 19, 17, 19, 15, 19, 17, 19, 17, 19, 17, 19, 18, 19, 17, 21, 19, 21, 19, 21, 19, 21, 19, 21, 19, 21, 19, 21
Offset: 0

Views

Author

Rajan Murthy, Dec 22 2013

Keywords

Comments

The first decrease from a(4) = 3 to a(5) = 2 occurs when the radius squared increases from an arbitrary position between 1 and 2 (when 3 squares are on the edge) to exactly 2 (when only 2 squares are on the edge because the circle of square radius 2 passes through the upper right corner on the y=x line). Similar decreases occur when the circle passes through other upper right corners. At least some (if not all) adjacent duplicates occur when the square radius corresponds to a perfect square, that is a corner which is only a lower right corner, i.e., on the y = 0 line. For example, a(6)=a(7)=3 occurs when, for n = 6 , a(n) corresponding to the interval between 2 and 4; and, for n=7, a(n) corresponding to the exact square radius of 4. Some of the confusion may come from the fact that for odd n, there is a unique circle corresponding to elements of a(n) (passing through the corner of specific square(s) on the grid), while for even n, there is a set of circles with a range of radii (which do not pass through corners) corresponding to the elements of a(n). It seems easier to organize the concept in terms of intervals and corners for the sake of consistency.
a(n) is even when the radius squared corresponds to an element of A024517.

Examples

			At radius 0, there are no partially filled squares.  At radius >1 but < sqrt(2), there are 3 partially filled squares along the edge of the circle.  At radius = sqrt(2), there are 2 partially filled squares along the edge of the circle.
		

Crossrefs

Cf. A001481 (corresponds to the square radius of alternate entries), A232499 (number of completely encircled squares when the radii are indexed by A000404), A235141 (first differences), A024517.
A237708 is the analog for the 3-dimensional Cartesian lattice and A239353 for the 4-dimensional Cartesian lattice.

Programs

  • Scilab
    function index = n_edgeindex (N)
        if N < 1 then
            N = 1
        end
        N = floor(N)
        i = 0:ceil(N/2)
        i = i^2
        index = i
        for j = 1:length(i)
           index = [index i+ i(j).*ones(i)]
        end
        index = unique(index)
        index = index(1:ceil(N))
        d = diff(index)/2
        d = d +  index(1:length(d))
        index = gsort([index d],"g","i")
        index = index(1:N)
    endfunction
    function l = n_edge_n (i)
            l=0
            h=0
            while (i > (2*h^2))
                h=h+1
            end
            if i < (2*h^2) then
                    l = l+1
            end
            if i >1 then
                t=[0 1]
               while (i>max(t))
                   t = [t (sqrt(max(t))+1)^2]
               end
            for j = 1:h
               b=t
               t=[2*(j)^2 (j+1)^2 + (j)^2]
               while (i>max(t))
                   t = [t (sqrt(max(t)-(j)^2)+1)^2 + (j)^2]
               end
               l = l+ 2*(length(b)-length(t))
               if max(t) == i then
                   l = l-2
               end
            end
           end
    endfunction
    function a =n_edge (N)
        if N <1 then
            N =1
        end
        N = floor(N)
        a= []
        index = n_edgeindex(N)
        for i = index
            a = [a n_edge_n(i)]
        end
    endfunction

Formula

a(2k+1) = a(2k) + 2*A000161(A001481(k+1)) - A010052(A001481(k+1)/2). - Rajan Murthy, Jan 14 2013
a(2k) = a(2k-1) - 2*(A000161(A001481(k+1)) - A010052(A001481(k+1))) + A010052(A001481(k+1)/2). - Rajan Murthy, Jan 14 2013

A229904 Number of additional unit squares completely encircled in the first quadrant of a Cartesian grid by a circle centered at the origin as the radius squared increases from one sum of two square integers to the next larger sum of two square integers.

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 4, 2, 1, 2, 2, 2, 2, 4, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 1, 4, 2, 2, 4, 2, 2, 2, 2, 2, 2, 1, 2, 2, 4, 2, 2, 2, 2
Offset: 1

Views

Author

Rajan Murthy and Vale Murthy, Dec 19 2013

Keywords

Comments

From Mohammed Yaseen, Apr 23 2025: (Start)
a(n) is the number of solutions to x^2 + y^2 = A000404(n), x,y,z >= 1.
a(n) are the degeneracies of the energy levels of a particle in a two-dimensional box in quantum mechanics. See A014465 for the three-dimensional box case. (End)

Examples

			When the radius increases from 0 to sqrt(2), one square is completely encircled (a(1)).  When the radius increases from sqrt(2) to sqrt(3), two more squares are encircled (a(2)).  When the radius increases from sqrt(45) to sqrt(50), three more squares are encircled(a(18)).
		

Crossrefs

First differences of A232499.
Radii are the square roots of A000404.
The first differences must be odd at positions given in A024517 by proof by symmetry as r^2=2*n^2 is on the x=y line.

Formula

a(n) = A232499(n) - A232499(n-1) for n>1, a(1) = A232499(1).
Showing 1-3 of 3 results.