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.

A057655 The circle problem: number of points (x,y) in square lattice with x^2 + y^2 <= n.

Original entry on oeis.org

1, 5, 9, 9, 13, 21, 21, 21, 25, 29, 37, 37, 37, 45, 45, 45, 49, 57, 61, 61, 69, 69, 69, 69, 69, 81, 89, 89, 89, 97, 97, 97, 101, 101, 109, 109, 113, 121, 121, 121, 129, 137, 137, 137, 137, 145, 145, 145, 145, 149, 161, 161, 169, 177, 177, 177
Offset: 0

Views

Author

N. J. A. Sloane, Oct 15 2000

Keywords

Examples

			a(0) = 1 (counting origin).
a(1) = 5 since 4 points lie on the circle of radius sqrt(1) + origin.
a(2) = 9 since 4 lattice points lie on the circle w/radius = sqrt(2) (along diagonals) + 4 points inside the circle + origin. - _Wesley Ivan Hurt_, Jan 10 2013
		

References

  • C. Alsina and R. B. Nelsen, Charming Proofs: A Journey Into Elegant Mathematics, Math. Assoc. Amer., 2010, p. 42.
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • F. Fricker, Einfuehrung in die Gitterpunktlehre, Birkhäuser, Boston, 1982.
  • P. de la Harpe, Topics in Geometric Group Theory, Univ. Chicago Press, 2000, p. 5.
  • E. Kraetzel, Lattice Points, Kluwer, Dordrecht, 1988.
  • C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 51.
  • W. Sierpiński, Elementary Theory of Numbers, Elsevier, North-Holland, 1988.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 245-246.

Crossrefs

Partial sums of A004018. Cf. A014198, A057656, A057961, A057962, A122510. For another version see A000328.
Cf. A038589 (for hexagonal lattice).

Programs

  • Haskell
    a057655 n = length [(x,y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 <= n]
    -- Reinhard Zumkeller, Jan 23 2012
    
  • Maple
    N:= 1000: # to get a(0) to a(N)
    R:= Array(0..N):
    for a from 0 to floor(sqrt(N)) do
      for b from 0 to floor(sqrt(N-a^2)) do
        r:= a^2 + b^2;
        R[r]:= R[r] + (2 - charfcn[0](a))*(2 - charfcn[0](b));
      od
    od:
    convert(map(round,Statistics:-CumulativeSum(R)),list); # Robert Israel, Sep 29 2014
  • Mathematica
    f[n_] := 1 + 4Sum[ Floor@ Sqrt[n - k^2], {k, 0, Sqrt[n]}]; Table[ f[n], {n, 0, 60}] (* Robert G. Wilson v, Jun 16 2006 *)
    Accumulate[ SquaresR[2, Range[0, 55]]] (* Jean-François Alcover, Feb 24 2012 *)
    CoefficientList[Series[EllipticTheta[3,0,x]^2/(1-x), {x, 0, 100}], x] (* Vaclav Kotesovec, Sep 29 2014 after Robert Israel *)
  • PARI
    a(n)=sum(x=-n,n,sum(y=-n,n,if((sign(x^2+y^2-n)+1)*sign(x^2+y^2-n),0,1)))
    
  • PARI
    a(n)=1+4*sum(k=0,sqrtint(n), sqrtint(n-k^2) ); /* Benoit Cloitre, Oct 08 2012 */
    
  • Python
    from math import isqrt
    def A057655(n): return 1+(sum(isqrt(n-k**2) for k in range(isqrt(n)+1))<<2) # Chai Wah Wu, Jul 31 2023

Formula

a(n) = 1 + 4*{ [n/1] - [n/3] + [n/5] - [n/7] + ... }. - Gauss
a(n) = 1 + 4*Sum_{ k = 0 .. [sqrt(n)] } [ sqrt(n-k^2) ]. - Liouville (?)
a(n) - Pi*n = O(sqrt(n)) (Gauss). a(n) - Pi*n = O(n^c), c = 23/73 + epsilon ~ 0.3151 (Huxley). If a(n) - Pi*n = O(n^c) then c > 1/4 (Landau, Hardy). It is conjectured that a(n) - Pi*n = O(n^(1/4 + epsilon)) for all epsilon > 0.
a(n) = A014198(n) + 1.
a(n) = A122510(2,n). - R. J. Mathar, Apr 21 2010
a(n) = 1 + sum((floor(1/(k+1)) + 4 * floor(cos(Pi * sqrt(k))^2) - 4 * floor(cos(Pi * sqrt(k/2))^2) + 8 * sum((floor(cos(Pi * sqrt(i))^2) * floor(cos(Pi * sqrt(k-i))^2)), i = 1..floor(k/2))), k = 1..n). - Wesley Ivan Hurt, Jan 10 2013
G.f.: theta_3(0,x)^2/(1-x) where theta_3 is a Jacobi theta function. - Robert Israel, Sep 29 2014
a(n^2) = A000328(n). - R. J. Mathar, Aug 03 2025

A038590 Sizes of clusters in hexagonal lattice A_2 centered at lattice point.

Original entry on oeis.org

1, 7, 13, 19, 31, 37, 43, 55, 61, 73, 85, 91, 97, 109, 121, 127, 139, 151, 163, 169, 187, 199, 211, 223, 235, 241, 253, 265, 271, 283, 295, 301, 313, 337, 349, 361, 367, 379, 385, 397, 409, 421, 433, 439, 451, 463, 475, 499, 511, 517, 535, 547
Offset: 0

Views

Author

Keywords

Comments

The hexagonal lattice is the familiar 2-dimensional lattice in which each point has 6 neighbors. This is sometimes called the triangular lattice.
The sequence can be approximated by a linear function with a correction term. See link for the function and representation of the deviation. The structures in the difference function can also be set to music after scaling. Some MIDI examples are linked. - Hugo Pfoertner, Mar 16 2024

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 111.
  • B. K. Teo and N. J. A. Sloane, Atomic Arrangements and Electronic Requirements for Close-Packed Circular and Spherical Clusters, Inorganic Chemistry, 25 (1986), pp. 2315-2322. See Table IV.

Crossrefs

Formula

Unique(A038589). Or, partial sums of A035019.

A014201 Number of solutions to x^2 + x*y + y^2 <= n excluding (0,0).

Original entry on oeis.org

0, 6, 6, 12, 18, 18, 18, 30, 30, 36, 36, 36, 42, 54, 54, 54, 60, 60, 60, 72, 72, 84, 84, 84, 84, 90, 90, 96, 108, 108, 108, 120, 120, 120, 120, 120, 126, 138, 138, 150, 150, 150, 150, 162, 162, 162, 162, 162, 168, 186, 186, 186, 198, 198, 198, 198, 198, 210
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[ Length[ {ToRules[ Reduce[ x^2 + x*y + y^2 == k, {x, y}, Integers]]}], {k, 1, n}]; Table[ a[n], {n, 0, 48}] (* Jean-François Alcover, Feb 23 2012 *)
  • PARI
    a(n)=6*sum(k=0, n\3, (n\(3*k+1))-(n\(3*k+2))) \\ Benoit Cloitre, Oct 27 2012

Formula

Equals A038589(n) - 1. - Neven Juric, May 10 2010
From Benoit Cloitre, Oct 27 2012: (Start)
a(n) = 6*Sum_{k=0..n/3} (floor(n/(3*k+1)) - floor(n/(3*k+2))).
a(n) is asymptotic to 2*(Pi/sqrt(3))*n.
Conjecture: a(n) = 2*(Pi/sqrt(3))*n + O(n^(1/4 + epsilon)), similar to the Gauss circle or Dirichlet divisor problems. (End)

A218146 The number of centered circles that can form hexagonal symmetry. Contains all hexagonal numbers.

Original entry on oeis.org

1, 7, 13, 19, 31, 37, 43, 55, 61, 91, 97, 109, 121, 127, 139, 151, 163, 169, 217, 229, 241, 253, 265, 271, 283, 295, 307, 319, 331, 343, 355, 367, 379, 391, 397
Offset: 1

Views

Author

Jason Betts, Oct 21 2012

Keywords

Comments

B(n) contain all of the hexagonal numbers such that: 1. Bn(m) = H(n), each subsequence always starts with a hexagonal number; 2. Bn(m) < H(n+1), all values of Bn(m) are less than the next hexagonal number; 3. If n=odd, the number of terms of Bn(m), m = { (n-1)/2 + 1}; 4. If n=even, the number of terms of Bn(m), m = { (n/2) + 1}.
1. All items describe a radial symmetrical geometric shape around a central circle.
2. All items are symmetrically reflective and are never non-trigional in geometry.
3. All hexagonal numbers are contained within this set of Radial Numbers, B(n).
4. The first term is 1, which is also the first Pythagorean Square and Triangular number. However, as the set B(n) must contain a central circle, this precludes most Pythagorean Triangular Numbers as they do not have a central circle, with 91 being the next one after 1.
5. Start with n=1, where n is the number of circles from the radius to the circumference of the figure and is also the number of circles along the side of the complete hexagonal figure, having the total hexagonal number of circles.
6. If n=odd, then the number of terms from the last hexagonal number to the next hexagonal number are {((n-1)/2) +1}, by adding 2 circles to the center of each side, symmetrically from middle outwards, for each term (12 circles), except for the last term which will always be 1 circle that fills in the corners to make the complete hexagonal geometry (6 circles). Thus { (m-1)x12 + 6 }
7. If n=even, then the number of terms from the last hexagonal number to the next hexagonal number are {(n/2) +1}, by adding 1 circle to the middle of each side as the first term (6 circles), then add 2 circles to each side for each consequent term (12 circles), except for the last term which will always be 1 circle that fills in the corners to make the complete hexagonal geometry (6 circles). Thus {6 + (m-2)x12 + 6} = { (m-1) x 12 }, for all m>2.
The definition is not clear to me, but it sounds like this should be the same as A038590 (the partial sums of A035019). See also A004016. - N. J. A. Sloane, Dec 08 2012

Examples

			First terms for Bn, where n denotes the number of circles of the radius, including the center:
B1(1) = H(1) = 1.
B1(2) = B(1) + 6 = 7, as n=odd, m=1 term, the only term is 6; H(2)=7.
B2(3) = B(2) + 6 = 13, as n=even, number of terms m=2, the first term is 6.
B2(4) = B(3) + 6 = 19, as n=even, number of terms m=2, last term is 6; H(3)=19.
B3(5) = B(4) + 12 = 31, as n=odd, number of terms m=2, first term is 12.
B3(6) = B(5) + 6 = 37, as n=odd, number of terms m=2, last term is 6; H(4)=37.
B4(7) = B(6) + 6 = 43, as n=even, number of terms m=3, first term is 6.
B4(8) = B(7) + 12 = 55, as n=even, number of terms m=3, second term is 12.
B4(9) = B(8) + 6 = 61, as n=even, number of terms m=3, third term is 6; H(5)=61.
B5(10) = B(9) + 12 = 73, as n=odd, number of terms m=3, first term is 12.
B5(11) = B(10) + 12 = 85, as n=odd, number of terms m=3, second term is 12.
B5(12) = B(11) + 6 = 91, as n=odd, number of terms m=3, third term is 6; H(6)=91.
		

References

  • Jason Betts, Maths Experiments, Software Publications, 2005, 36-40.

Crossrefs

A003215 is a subsequence.

Formula

For all hexagonal numbers H(n), there exists a sequence B(n) such that H(n) < B(n) < .. < B(n+m) < H(n+1), where m = {(n/2)+1} if n=even and m={(n-1)/2 +1} if n=odd.
1. Bn(m) = H(n), each subsequence always starts with a hexagonal number.
2. Bn(m) < H(n+1), all values of Bn(m) are less than the next hexagonal number.
3. If n=odd, the number of terms of Bn(m), m = { (n-1)/2 + 1}
4. If n=even, the number of terms of Bn(m), m = { (n/2) + 1}
Showing 1-4 of 4 results.