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 29 results. Next

A004018 Theta series of square lattice (or number of ways of writing n as a sum of 2 squares). Often denoted by r(n) or r_2(n).

Original entry on oeis.org

1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 0, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8
Offset: 0

Views

Author

Keywords

Comments

Number of points in square lattice on the circle of radius sqrt(n). Equivalently, number of Gaussian integers of norm n (cf. Conway-Sloane, p. 106).
Let b(n)=A004403(n), then Sum_{k=1..n} a(k)*b(n-k) = 1. - John W. Layman
Theta series of D_2 lattice.
Number 6 of the 74 eta-quotients listed in Table I of Martin (1996).
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
The zeros in this sequence correspond to those integers with an equal number of 4k+1 and 4k+3 divisors, or equivalently to those that have at least one 4k+3 prime factor with an odd exponent (A022544). - Ant King, Mar 12 2013
If A(q) = 1 + 4*q + 4*q^2 + 4*q^4 + 8*q^5 + ... denotes the o.g.f. of this sequence then the function F(q) := 1/4*(A(q^2) - A(q^4)) = ( Sum_{n >= 0} q^(2*n+1)^2 )^2 is the o.g.f. for counting the ways a positive integer n can be written as the sum of two positive odd squares. - Peter Bala, Dec 13 2013
Expansion coefficients of (2/Pi)*K, with the real quarter period K of elliptic functions, as series of the Jacobi nome q, due to (2/Pi)*K = theta_3(0,q)^2. See, e.g., Whittaker-Watson, p. 486. - Wolfdieter Lang, Jul 15 2016
Sum_{k=0..n} a(n) = A057655(n). Robert G. Wilson v, Dec 22 2016
Limit_{n->oo} (a(n)/n - Pi*log(n)) = A062089: Sierpinski's constant. - Robert G. Wilson v, Dec 22 2016
The mean value of a(n) is Pi, see A057655 for more details. - M. F. Hasler, Mar 20 2017

Examples

			G.f. = 1 + 4*q + 4*q^2 + 4*q^4 + 8*q^5 + 4*q^8 + 4*q^9 + 8*q^10 + 8*q^13 + 4*q^16 + 8*q^17 + 4*q^18 + 8*q^20 + 12*q^25 + 8*q^26 + ... . - _John Cannon_, Dec 30 2006
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 162, #16 (7), r(n).
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 78, Eq. (32.23).
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 15, p. 32, Lemma 2 (with the proof), p. 116, (9.10) first formula.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 133.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 240, r(n).
  • W. König and J. Sprekels, Karl Weierstraß (1815-1897), Springer Spektrum, Wiesbaden, 2016, p. 186-187 and p. 280-281.
  • C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 51.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 244-245.
  • E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, fourth edition, reprinted, 1958, Cambridge at the University Press.

Crossrefs

Row d=2 of A122141 and of A319574, 2nd column of A286815.
Partial sums - 1 give A014198.
A071385 gives records; A071383 gives where records occur.

Programs

  • Julia
    # JacobiTheta3 is defined in A000122.
    A004018List(len) = JacobiTheta3(len, 2)
    A004018List(102) |> println # Peter Luschny, Mar 12 2018
    
  • Magma
    Basis( ModularForms( Gamma1(4), 1), 100) [1]; /* Michael Somos, Jun 10 2014 */
    
  • Maple
    (sum(x^(m^2),m=-10..10))^2;
    # Alternative:
    A004018list := proc(len) series(JacobiTheta3(0, x)^2, x, len+1);
    seq(coeff(%, x, j), j=0..len-1) end:
    t1 := A004018list(102);
    r2 := n -> t1[n+1]; # Peter Luschny, Oct 02 2018
  • Mathematica
    SquaresR[2,Range[0,110]] (* Harvey P. Dale, Oct 10 2011 *)
    a[ n_] := SquaresR[ 2, n]; (* Michael Somos, Nov 15 2011 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^2, {q, 0, n}]; (* Michael Somos, Nov 15 2011 *)
    a[ n_] := With[{m = InverseEllipticNomeQ @ q}, SeriesCoefficient[ EllipticK[ m] / (Pi/2), {q, 0, n}]]; (* Michael Somos, Jun 10 2014 *)
    a[ n_] := If[ n < 1, Boole[n == 0], 4 Sum[ KroneckerSymbol[-4, d], {d, Divisors@n}]]; (* or *) a[ n_] := SeriesCoefficient[ QPochhammer[ q^2]^10/(QPochhammer[ q] QPochhammer[ q^4])^4, {q, 0, n}]; (* Michael Somos, May 17 2015 *)
  • PARI
    {a(n) = polcoeff( 1 + 4 * sum( k=1, n, x^k / (1 + x^(2*k)), x * O(x^n)), n)}; /* Michael Somos, Mar 14 2003 */
    
  • PARI
    {a(n) = if( n<1, n==0, 4 * sumdiv( n, d, (d%4==1) - (d%4==3)))}; /* Michael Somos, Jul 19 2004 */
    
  • PARI
    {a(n) = if( n<1, n==0, 2 * qfrep([ 1, 0; 0, 1], n)[n])}; /* Michael Somos, May 13 2005 */
    
  • PARI
    a(n)=if(n==0,return(1)); my(f=factor(n)); 4*prod(i=1,#f~, if(f[i,1]%4==1, f[i,2]+1, if(f[i,2]%2 && f[i,1]>2, 0, 1))) \\ Charles R Greathouse IV, Sep 02 2015
    
  • Python
    from sympy import factorint
    def a(n):
        if n == 0: return 1
        an = 4
        for pi, ei in factorint(n).items():
           if pi%4 == 1: an *= ei+1
           elif pi%4 == 3 and ei%2: return 0
        return an
    print([a(n) for n in range(102)]) # Michael S. Branicky, Sep 24 2021
    
  • Python
    from math import prod
    from sympy import factorint
    def A004018(n): return prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in factorint(n).items())<<2 if n else 1 # Chai Wah Wu, Jul 07 2022, corrected Jun 21 2024.
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*2)
    Q.representation_number_list(102) # Peter Luschny, Jun 20 2014
    

Formula

Expansion of theta_3(q)^2 = (Sum_{n=-oo..+oo} q^(n^2))^2 = Product_{m>=1} (1-q^(2*m))^2 * (1+q^(2*m-1))^4; convolution square of A000122.
Factor n as n = p1^a1 * p2^a2 * ... * q1^b1 * q2^b2 * ... * 2^c, where the p's are primes == 1 (mod 4) and the q's are primes == 3 (mod 4). Then a(n) = 0 if any b is odd, otherwise a(n) = 4*(1 + a1)*(1 + a2)*...
G.f. = s(2)^10/(s(1)^4*s(4)^4), where s(k) := subs(q=q^k, eta(q)) and eta(q) is Dedekind's function, cf. A010815. [Fine]
a(n) = 4*A002654(n), n > 0.
Expansion of eta(q^2)^10 / (eta(q) * eta(q^4))^4 in powers of q. - Michael Somos, Jul 19 2004
Expansion of ( phi(q)^2 + phi(-q)^2 ) / 2 in powers of q^2 where phi() is a Ramanujan theta function.
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u - v)^2 - (v - w) * 4 * w. - Michael Somos, Jul 19 2004
Euler transform of period 4 sequence [4, -6, 4, -2, ...]. - Michael Somos, Jul 19 2004
Moebius transform is period 4 sequence [4, 0, -4, 0, ...]. - Michael Somos, Sep 17 2007
G.f. is a period 1 Fourier series which satisfies f(-1 / (4 t)) = 2 (t/i) f(t) where q = exp(2 Pi i t).
The constant sqrt(Pi)/Gamma(3/4)^2 produces the first 324 terms of the sequence when expanded in base exp(Pi), 450 digits of the constant are necessary. - Simon Plouffe, Mar 03 2011
a(n) = A004531(4*n). a(n) = 2*A105673(n), if n>0.
Let s = 16*q*(E1*E4^2/E2^3)^8 where Ek = Product_{n>=1} (1-q^(k*n)) (s=k^2 where k is elliptic k), then the g.f. is hypergeom([+1/2, +1/2], [+1], s) (expansion of 2/Pi*ellipticK(k) in powers of q). - Joerg Arndt, Aug 15 2011
Dirichlet g.f. Sum_{n>=1} a(n)/n^s = 4*zeta(s)*L_(-4)(s), where L is the D.g.f. of the (shifted) A056594. [Raman. J. 7 (2003) 95-127]. - R. J. Mathar, Jul 02 2012
a(n) = floor(1/(n+1)) + 4*floor(cos(Pi*sqrt(n))^2) - 4*floor(cos(Pi*sqrt(n/2))^2) + 8*Sum_{i=1..floor(n/2)} floor(cos(Pi*sqrt(i))^2)*floor(cos(Pi*sqrt(n-i))^2). - Wesley Ivan Hurt, Jan 09 2013
From Wolfdieter Lang, Aug 01 2016: (Start)
A Jacobi identity: theta_3(0, q)^2 = 1 + 4*Sum_{r>=0} (-1)^r*q^(2*r+1)/(1 - q^(2*r+1)). See, e.g., the Grosswald reference (p. 15, p. 116, but p. 32, Lemma 2 with the proof, has the typo r >= 1 instead of r >= 0 in the sum, also in the proof). See the link with the Jacobi-Legendre letter.
Identity used by Weierstraß (see the König-Sprekels book, p. 187, eq. (5.12) and p. 281, with references, but there F(x) from (5.11) on p. 186 should start with nu =1 not 0): theta_3(0, q)^2 = 1 + 4*Sum_{n>=1} q^n/(1 + q^(2*n)). Proof: similar to the one of the preceding Jacobi identity. (End)
a(n) = (4/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
G.f.: Theta_3(q)^2 = hypergeometric([1/2, 1/2],[1],lambda(q)), with lambda(q) = Sum_{j>=1} A115977(j)*q^j. See the Kontsevich and Zagier link, with Theta -> Theta_3, z -> 2*z and q -> q^2. - Wolfdieter Lang, May 27 2018

A001106 9-gonal (or enneagonal or nonagonal) numbers: a(n) = n*(7*n-5)/2.

Original entry on oeis.org

0, 1, 9, 24, 46, 75, 111, 154, 204, 261, 325, 396, 474, 559, 651, 750, 856, 969, 1089, 1216, 1350, 1491, 1639, 1794, 1956, 2125, 2301, 2484, 2674, 2871, 3075, 3286, 3504, 3729, 3961, 4200, 4446, 4699, 4959, 5226, 5500, 5781, 6069, 6364
Offset: 0

Views

Author

Keywords

Comments

Sequence found by reading the line from 0, in the direction 0, 9, ... and the parallel line from 1, in the direction 1, 24, ..., in the square spiral whose vertices are the generalized 9-gonal (enneagonal) numbers A118277. Also sequence found by reading the same lines in the square spiral whose edges have length A195019 and whose vertices are the numbers A195020. - Omar E. Pol, Sep 10 2011
Number of ordered pairs of integers (x,y) with abs(x) < n, abs(y) < n and x+y <= n. - Reinhard Zumkeller, Jan 23 2012
Partial sums give A007584. - Omar E. Pol, Jan 15 2013

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 189.
  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 6.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A093564 ((7, 1) Pascal, column m=2). Partial sums of A016993.

Programs

  • Haskell
    a001106 n = length [(x,y) | x <- [-n+1..n-1], y <- [-n+1..n-1], x + y <= n]
    -- Reinhard Zumkeller, Jan 23 2012
    
  • Haskell
    a001106 n = n*(7*n-5) `div` 2 -- James Spahlinger, Oct 18 2012
    
  • Mathematica
    Table[n(7n - 5)/2, {n, 0, 50}] (* or *) LinearRecurrence[{3, -3, 1}, {0, 1, 9}, 50] (* Harvey P. Dale, Nov 06 2011 *)
    (* For Mathematica 10.4+ *) Table[PolygonalNumber[RegularPolygon[9], n], {n, 0, 43}] (* Arkadiusz Wesolowski, Aug 27 2016 *)
    PolygonalNumber[9,Range[0,50]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 19 2019 *)
  • PARI
    a(n)=n*(7*n-5)/2 \\ Charles R Greathouse IV, Jun 10 2011
    
  • Python
    def aList(): # Intended to compute the initial segment of the sequence, not isolated terms.
         x, y = 1, 1
         yield 0
         while True:
             yield x
             x, y = x + y + 7, y + 7
    A001106 = aList()
    print([next(A001106) for i in range(49)]) # Peter Luschny, Aug 04 2019

Formula

a(n) = (7*n - 5)*n/2.
G.f.: x*(1+6*x)/(1-x)^3. - Simon Plouffe in his 1992 dissertation.
a(n) = n + 7*A000217(n-1). - Floor van Lamoen, Oct 14 2005
Starting (1, 9, 24, 46, 75, ...) gives the binomial transform of (1, 8, 7, 0, 0, 0, ...). - Gary W. Adamson, Jul 22 2007
Row sums of triangle A131875 starting (1, 9, 24, 46, 75, 111, ...). A001106 = binomial transform of (1, 8, 7, 0, 0, 0, ...). - Gary W. Adamson, Jul 22 2007
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3), a(0) = 0, a(1) = 1, a(2) = 9. - Jaume Oliver Lafont, Dec 02 2008
a(n) = 2*a(n-1) - a(n-2) + 7. - Mohamed Bouhamida, May 05 2010
a(n) = a(n-1) + 7*n - 6 (with a(0) = 0). - Vincenzo Librandi, Nov 12 2010
a(n) = A174738(7n). - Philippe Deléham, Mar 26 2013
a(7*a(n) + 22*n + 1) = a(7*a(n) + 22*n) + a(7*n+1). - Vladimir Shevelev, Jan 24 2014
E.g.f.: x*(2 + 7*x)*exp(x)/2. - Ilya Gutkovskiy, Jul 28 2016
a(n+2) + A000217(n) = (2*n+3)^2. - Ezhilarasu Velayutham, Mar 18 2020
Product_{n>=2} (1 - 1/a(n)) = 7/9. - Amiram Eldar, Jan 21 2021
Sum_{n>=1} 1/a(n) = A244646. - Amiram Eldar, Nov 12 2021
a(n) = A000217(3*n-2) - (n-1)^2. - Charlie Marion, Feb 27 2022
a(n) = 3*A000217(n) + 2*A005563(n-2). In general, if P(k,n) = the n-th k-gonal number, then P(m*k,n) = m*P(k,n) + (m-1)*A005563(n-2). - Charlie Marion, Feb 21 2023

A069099 Centered heptagonal numbers.

Original entry on oeis.org

1, 8, 22, 43, 71, 106, 148, 197, 253, 316, 386, 463, 547, 638, 736, 841, 953, 1072, 1198, 1331, 1471, 1618, 1772, 1933, 2101, 2276, 2458, 2647, 2843, 3046, 3256, 3473, 3697, 3928, 4166, 4411, 4663, 4922, 5188, 5461, 5741, 6028, 6322, 6623, 6931, 7246
Offset: 1

Views

Author

Terrel Trotter, Jr., Apr 05 2002

Keywords

Comments

Equals the triangular numbers convolved with [ 1, 5, 1, 0, 0, 0, ...]. - Gary W. Adamson and Alexander R. Povolotsky, May 29 2009
Number of ordered pairs of integers (x,y) with abs(x) < n, abs(y) < n and abs(x + y) < n, counting twice pairs of equal numbers. - Reinhard Zumkeller, Jan 23 2012; corrected and extended by Mauro Fiorentini, Jan 01 2018
The number of pairs without repetitions is a(n) - 2n + 3 for n > 1. For example, there are 19 such pairs for n = 3: (-2, 0), (-2, 1), (-2, 2), (-1, -1), (-1, 0), (-1, 1), (-1, 2), (0, -2), (0, -1), (0, 0), (0, 1), (0, 2), (1, -2), (1, -1), (1, 0), (1, 1), (2, -2), (2, -1), (2, 0). - Mauro Fiorentini, Jan 01 2018

Examples

			a(5) = 71 because 71 = (7*5^2 - 7*5 + 2)/2 = (175 - 35 + 2)/2 = 142/2.
From _Bruno Berselli_, Oct 27 2017: (Start)
1   =         -(0) + (1).
8   =       -(0+1) + (2+3+4).
22  =     -(0+1+2) + (3+4+5+6+7).
43  =   -(0+1+2+3) + (4+5+6+7+8+9+10).
71  = -(0+1+2+3+4) + (5+6+7+8+9+10+11+12+13). (End)
		

Crossrefs

Cf. A000566 (heptagonal numbers).

Programs

Formula

a(n) = (7*n^2 - 7*n + 2)/2.
a(n) = 1 + Sum_{k=1..n} 7*k. - Xavier Acloque, Oct 26 2003
Binomial transform of [1, 7, 7, 0, 0, 0, ...]; Narayana transform (A001263) of [1, 7, 0, 0, 0, ...]. - Gary W. Adamson, Dec 29 2007
a(n) = 7*n + a(n-1) - 7 (with a(1)=1). - Vincenzo Librandi, Aug 08 2010
G.f.: x*(1+5*x+x^2) / (1-x)^3. - R. J. Mathar, Feb 04 2011
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3); a(0)=1, a(1)=8, a(2)=22. - Harvey P. Dale, Jun 04 2011
a(n) = A024966(n-1) + 1. - Omar E. Pol, Oct 03 2011
a(n) = 2*a(n-1) - a(n-2) + 7. - Ant King, Jun 17 2012
From Ant King, Jun 17 2012: (Start)
Sum_{n>=1} 1/a(n) = 2*Pi/sqrt(7)*tanh(Pi/(2*sqrt(7))) = 1.264723171685652...
a(n) == 1 (mod 7) for all n.
The sequence of digital roots of the a(n) is period 9: repeat [1, 8, 4, 7, 8, 7, 4, 8, 1] (the period is a palindrome).
The sequence of a(n) mod 10 is period 20: repeat [1, 8, 2, 3, 1, 6, 8, 7, 3, 6, 6, 3, 7, 8, 6, 1, 3, 2, 8, 1] (the period is a palindrome).
(End)
E.g.f.: -1 + (2 + 7*x^2)*exp(x)/2. - Ilya Gutkovskiy, Jun 30 2016
a(n) = A101321(7,n-1). - R. J. Mathar, Jul 28 2016
From Amiram Eldar, Jun 20 2020: (Start)
Sum_{n>=1} a(n)/n! = 9*e/2 - 1.
Sum_{n>=1} (-1)^n * a(n)/n! = 9/(2*e) - 1. (End)
a(n) = A003215(n-1) + A000217(n-1). - Leo Tavares, Jul 19 2022

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

A117609 Number of lattice points inside the ball x^2 + y^2 + z^2 <= n.

Original entry on oeis.org

1, 7, 19, 27, 33, 57, 81, 81, 93, 123, 147, 171, 179, 203, 251, 251, 257, 305, 341, 365, 389, 437, 461, 461, 485, 515, 587, 619, 619, 691, 739, 739, 751, 799, 847, 895, 925, 949, 1021, 1021, 1045, 1141, 1189, 1213, 1237, 1309, 1357, 1357, 1365, 1419, 1503
Offset: 0

Views

Author

John L. Drost, Apr 06 2006

Keywords

Examples

			a(2) = 1 + 6 + 12 = 19, since (0,0,0) and (0, 0, +-1) and cyclic permutations (for a total of 6 points), and +-(0, 1, +-1) and cyclic permutations (for a total 12 points) are inside or on x^2 + y^2 + z^2 = 2.
		

Crossrefs

Partial sums of A005875.
Cf. A000605 (number of points of norm <= n in cubic lattice).
Cf. A210639, A000092 and references therein.
Cf. A057655.

Programs

  • Mathematica
    Table[Sum[SquaresR[3,k], {k,0,n}], {n,0,50}] (* T. D. Noe, Apr 08 2006, revised Sep 27 2011 *)
  • PARI
    A117609(n)=sum(x=0,sqrtint(n),(sum(y=1,sqrtint(t=n-x^2),1+2*sqrtint(t-y^2))*2+sqrtint(t)*2+1)*2^(x>0)) \\ M. F. Hasler, Mar 26 2012
    
  • PARI
    q='q+O('q^66); Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^3/(1-q)) /* Joerg Arndt, Apr 08 2013 */
    
  • Python
    # uses Python code for A057655
    from math import isqrt
    def A117609(n): return A057655(n)+(sum(A057655(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 23 2024

Formula

a(n) ~ (4/3)*Pi*n^(3/2) ~ A210639(n).
a(n) = A122510(3,n). - R. J. Mathar, Apr 21 2010
G.f.: T3(q)^3/(1-q) where T3(q) = 1 + 2*Sum_{k>=1} q^(k^2). - Joerg Arndt, Apr 08 2013
a(n^2) = A000605(n). - R. J. Mathar, Aug 03 2025

A122510 Array T(d,n) = number of integer lattice points inside the d-dimensional hypersphere of radius sqrt(n), read by ascending antidiagonals.

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 1, 7, 9, 3, 1, 9, 19, 9, 5, 1, 11, 33, 27, 13, 5, 1, 13, 51, 65, 33, 21, 5, 1, 15, 73, 131, 89, 57, 21, 5, 1, 17, 99, 233, 221, 137, 81, 21, 5, 1, 19, 129, 379, 485, 333, 233, 81, 25, 7, 1, 21, 163, 577, 953, 797, 573, 297, 93, 29, 7, 1, 23, 201, 835, 1713, 1793
Offset: 1

Views

Author

R. J. Mathar, Oct 29 2006, Oct 31 2006

Keywords

Comments

Number of solutions to sum_(i=1,..,d) x[i]^2 <= n, x[i] in Z.

Examples

			T(2,2)=9 counts 1 pair (0,0) with sum 0, 4 pairs (-1,0),(1,0),(0,-1),(0,1) with sum 1 and 4 pairs (-1,-1),(-1,1),(1,1),(1,-1) with sum 2.
Array T(d,n) with rows d=1,2,3... and columns n=0,1,2,3.. reads
  1  3   3    3    5     5     5     5      5      7      7
  1  5   9    9   13    21    21    21     25     29     37
  1  7  19   27   33    57    81    81     93    123    147
  1  9  33   65   89   137   233   297    321    425    569
  1 11  51  131  221   333   573   893   1093   1343   1903
  1 13  73  233  485   797  1341  2301   3321   4197   5757
  1 15  99  379  953  1793  3081  5449   8893  12435  16859
  1 17 129  577 1713  3729  6865 12369  21697  33809  47921
  1 19 163  835 2869  7189 14581 27253  49861  84663 129303
  1 21 201 1161 4541 12965 29285 58085 110105 198765 327829
		

Crossrefs

Cf. A005408 (column 1), A058331 (column 2), A161712 (column 3), A055426 (column 4), A055427 (column 9)

Programs

  • Maple
    T := proc(d,n) local i,cnts ; cnts := 0 ; for i from -trunc(sqrt(n)) to trunc(sqrt(n)) do if n-i^2 >= 0 then if d > 1 then cnts := cnts+T(d-1,n-i^2) ; else cnts := cnts+1 ; fi ; fi ; od ; RETURN(cnts) ; end: for diag from 1 to 14 do for n from 0 to diag-1 do d := diag-n ; printf("%d,",T(d,n)) ; od ; od;
  • Mathematica
    t[d_, n_] := t[d, n] = t[d, n-1] + SquaresR[d, n]; t[d_, 0] = 1; Table[t[d-n, n], {d, 1, 12}, {n, 0, d-1}] // Flatten (* Jean-François Alcover, Jun 13 2013 *)

Formula

Recurrence along rows: T(d,n)=T(d,n-1)+A122141(d,n) for n>=1; T(d,n)=sum_{i=0..n} A122141(d,i). Recurrence along columns: cf. A123937.

A057961 Number of points in square lattice covered by a disc centered at (0,0) as its radius increases.

Original entry on oeis.org

1, 5, 9, 13, 21, 25, 29, 37, 45, 49, 57, 61, 69, 81, 89, 97, 101, 109, 113, 121, 129, 137, 145, 149, 161, 169, 177, 185, 193, 197, 213, 221, 225, 233, 241, 249, 253, 261, 277, 285, 293, 301, 305, 317, 325, 333, 341, 349, 357, 365, 373, 377, 385, 401, 405, 421
Offset: 1

Views

Author

Ken Takusagawa, Oct 15 2000

Keywords

Comments

Useful for rasterizing circles.
Conjecture: the number of lattice points in a quadrant of the disk is equal to A000592(n-1). - L. Edson Jeffery, Feb 10 2014

Examples

			a(2)=5 because (0,0); (0,1); (0,-1); (1,0); (-1,0) are covered by any disc of radius between 1 and sqrt(2).
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.

Crossrefs

Cf. A004018, A004020, A005883, A057962. Distinct terms of A057655.

Programs

  • Mathematica
    max = 100; A001481 = Select[Range[0, 4*max], SquaresR[2, #] != 0 &]; Table[SquaresR[2, A001481[[n]]], {n, 1, max}] // Accumulate (* Jean-François Alcover, Oct 04 2013 *)

A068785 Number of Cartesian lattice points in or on the circle x^2 + y^2 = 10^n.

Original entry on oeis.org

5, 37, 317, 3149, 31417, 314197, 3141549, 31416025, 314159053, 3141592409, 31415925457, 314159264013, 3141592649625, 31415926532017, 314159265350589, 3141592653588533, 31415926535867961, 314159265358987341, 3141592653589764829, 31415926535897744669
Offset: 0

Views

Author

Robert G. Wilson v, Mar 07 2002

Keywords

Comments

a(n) ~ Pi*10^n [Shanks, page 164]. "Gauss gave [a(2)] = 317 and [a(4)] = 31417." [Shanks, page 165].

References

  • Daniel Shanks, "Solved and Unsolved Problems in Number Theory," Fourth Edition, Chelsea Publishing Co., NY, 1993, pages 164-165 and 234 [gives a(n) for n = 8, 10, 12, 14].
  • Wolfram Research, Mathematica 4, Standard Add-On Packages, Wolfram Media, Inc., Champaign, Il, 1999, pages 322-3.

Crossrefs

Programs

  • Mathematica
    k = 1; s = 1; Do[s = s + SquaresR[2, n]; If[n == 10^k, k++; Print[s]], {n, 1, 10^6} ]

Formula

a(n) = Sum_{k=0..10^n} A004018(k). - Robert Israel, Jul 13 2014

Extensions

Definition and comments corrected by Jonathan Sondow, Dec 28 2012
a(0) corrected and a(9)-a(19) from Hiroaki Yamanouchi, Jul 13 2014

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

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Apr 01 2013

Keywords

Crossrefs

Cf. A000925 (first differences).
Cf. A000606 (number of nonnegative solutions to x^2 + y^2 + z^2 <= n).
Cf. A057655 (number of integer solutions to x^2 + y^2 <= n).

Programs

  • Mathematica
    nn = 68; t = Table[0, {nn}]; Do[d = x^2 + y^2; If[0 < d <= nn, t[[d]]++], {x, 0, nn}, {y, 0, nn}]; Accumulate[Join[{1}, t]] (* T. D. Noe, Apr 01 2013 *)
  • Python
    for n in range(99):
      k = 0
      for x in range(99):
        s = x*x
        if s>n: break
        for y in range(99):
            sy = s + y*y
            if sy>n: break
            k+=1
      print(str(k), end=', ')

Formula

G.f.: (1/(1 - x))*(Sum_{k>=0} x^(k^2))^2. - Ilya Gutkovskiy, Mar 14 2017

A000036 Let A(n) = #{(i,j): i^2 + j^2 <= n}, V(n) = Pi*n, P(n) = A(n) - V(n); A000099 gives values of n where |P(n)| sets a new record; sequence gives closest integer to P(A000099(n)).

Original entry on oeis.org

2, 3, 5, 6, 6, -6, 7, 8, 10, 13, 13, 13, 14, -17, 17, 17, 18, -19, 20, -22, 23, 27, -29, -29, 29, -31, -32, -35, 36, -37, -40, -43, -46, -48, -50, -53, -55, -57, -60, -60, -61, -63, -66, -66, -68, -71, -74, -77, -79, -82, -85, -88, -89, -92, -95, -96, -97, -97, -100
Offset: 1

Views

Author

Keywords

References

  • 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

Programs

  • Mathematica
    nmax = 6*10^4; A[n_] := 1 + 4*Floor[Sqrt[n]] + 4*Floor[Sqrt[n/2]]^2 + 8* Sum[Floor[Sqrt[n - j^2]], {j, Floor[Sqrt[n/2]] + 1, Floor[Sqrt[n]]}]; V[n_] := Pi*n; P[n_] := A[n] - V[n]; record = 0; A000036 = Reap[For[k = 0; n = 1, n <= nmax, n++, p = Abs[pn = P[n]]; If[p > record, record = p; k++; Sow[pn // Round]; Print["a(", k, ") = ", pn // Round]]]][[2, 1]] (* Jean-François Alcover, Feb 03 2016 *)

Formula

a(n) = round(P(A000099(n))), where P(n) = A057655(n)-pi*n. - David W. Wilson, May 15 2008

Extensions

Revised by N. J. A. Sloane, Jun 26 2005
More terms from David W. Wilson, May 15 2008
Showing 1-10 of 29 results. Next