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

A210641 A117609(n)-A210639(n): Difference between number of lattice points in the ball x^2+y^2+z^2 <= n and the volume of this ball rounded to the nearest integer.

Original entry on oeis.org

1, 3, 7, 5, -1, 10, 19, 3, -2, 10, 15, 18, 5, 7, 32, 8, -11, 11, 21, 18, 14, 34, 29, -1, -7, -9, 32, 31, -2, 37, 51, 16, -7, 5, 17, 28, 20, 6, 40, 1, -15, 41, 49, 32, 14, 45, 50, 7, -28, -18, 22, 25, 4, 31, 81, 34, 36, 36, 13, 37, -12, 11, 58, 8, -36, 10, 55
Offset: 0

Views

Author

M. F. Hasler, Mar 26 2012

Keywords

Comments

Record values are listed in A000223, and A000092 gives the corresponding indices. Strictly speaking, these are defined using the absolute values, but it appears they always occur at positive elements.

Programs

A005875 Theta series of simple cubic lattice; also number of ways of writing a nonnegative integer n as a sum of 3 squares (zero being allowed).

Original entry on oeis.org

1, 6, 12, 8, 6, 24, 24, 0, 12, 30, 24, 24, 8, 24, 48, 0, 6, 48, 36, 24, 24, 48, 24, 0, 24, 30, 72, 32, 0, 72, 48, 0, 12, 48, 48, 48, 30, 24, 72, 0, 24, 96, 48, 24, 24, 72, 48, 0, 8, 54, 84, 48, 24, 72, 96, 0, 48, 48, 24, 72, 0, 72, 96, 0, 6, 96, 96, 24, 48, 96, 48, 0, 36, 48, 120
Offset: 0

Views

Author

Keywords

Comments

Number of ordered triples (i, j, k) of integers such that n = i^2 + j^2 + k^2.
The Madelung Coulomb energy for alternating unit charges in the simple cubic lattice is Sum_{n>=1} (-1)^n*a(n)/sqrt(n) = -A085469. - R. J. Mathar, Apr 29 2006
a(A004215(k))=0 for k=1,2,3,... but no other elements of {a(n)} are zero. - Graeme McRae, Jan 15 2007

Examples

			Order and signs are taken into account: a(1) = 6 from 1 = (+-1)^2 + 0^2 + 0^2, a(2) = 12 from 2 = (+-1)^2 + (+-1)^2 + 0^2; a(3) = 8 from 3 = (+-1)^2 + (+-1)^2 + (+-1)^2, etc.
G.f. =  1 + 6*q + 12*q^2 + 8*q^3 + 6*q^4 + 24*q^5 + 24*q^6 + 12*q^8 + 30*q^9 + 24*q^10 + ...
		

References

  • H. Cohen, Number Theory, Vol. 1: Tools and Diophantine Equations, Springer-Verlag, 2007, p. 317.
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th ed., 1999, Chapter V.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 3, p. 109.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 54.
  • L. Kronecker, Crelle, Vol. LVII (1860), p. 248; Werke, Vol. IV, p. 188.
  • C. J. Moreno and S. S. Wagstaff, Jr., Sums of Squares of Integers, Chapman and Hall, 2006, p. 43.
  • T. Nagell, Introduction to Number Theory, Wiley, 1951, p. 194.
  • W. Sierpiński, 1925. Teorja Liczb. pp. 1-410 (p.61).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • H. J. S. Smith, Report on the Theory of Numbers, reprinted in Vol. 1 of his Collected Math. Papers, Chelsea, NY, 1979, see p. 338, Eq. (B').

Crossrefs

Row d=3 of A122141 and of A319574, 3rd column of A286815.
Cf. A074590 (primitive solutions), A117609 (partial sums), A004215 (positions of zeros).
Analog for 4 squares: A000118.
x^2+y^2+k*z^2: A005875, A014455, A034933, A169783, A169784.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Programs

  • Julia
    # JacobiTheta3 is defined in A000122.
    A005875List(len) = JacobiTheta3(len, 3)
    A005875List(75) |> println # Peter Luschny, Mar 12 2018
    
  • Magma
    Basis( ModularForms( Gamma1(4), 3/2), 75) [1]; /* Michael Somos, Jun 25 2014 */
    
  • Maple
    (sum(x^(m^2),m=-10..10))^3; seq(coeff(%,x,n), n=0..50);
    Alternative:
    A005875list := proc(len) series(JacobiTheta3(0, x)^3, x, len+1);
    seq(coeff(%, x, j), j=0..len-1) end: A005875list(75); # Peter Luschny, Oct 02 2018
  • Mathematica
    SquaresR[3,Range[0,80]] (* Harvey P. Dale, Jul 21 2011 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^3, {q, 0, n}]; (* Michael Somos, Jun 25 2014 *)
    a[ n_] := Length @ FindInstance[ n == x^2 + y^2 + z^2, {x, y, z}, Integers, 10^9]; (* Michael Somos, May 21 2015 *)
    QP = QPochhammer; CoefficientList[(QP[q^2]^5/(QP[q]*QP[q^4])^2)^3 + O[q]^80, q] (* Jean-François Alcover, Nov 24 2015 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum( k=1, sqrtint(n), 2 * x^k^2, 1 + x * O(x^n))^3, n))};
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^5 / (eta(x + A) * eta(x^4 + A))^2)^3, n))}; /* Michael Somos, Jun 03 2012 */
    
  • PARI
    {a(n) = my(G); if( n<0, 0, G = [ 1, 0, 0; 0, 1, 0; 0, 0, 1]; polcoeff( 1 + 2 * x * Ser( qfrep( G, n)), n))}; /* Michael Somos, May 21 2015 */
    
  • Python
    # uses Python code for A004018
    from math import isqrt
    def A005875(n): return A004018(n)+(sum(A004018(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 21 2024
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*3)
    Q.representation_number_list(75) # Peter Luschny, Jun 20 2014
    

Formula

A number n is representable as the sum of 3 squares iff n is not of the form 4^a (8k+7) (cf. A000378).
There is a classical formula (essentially due to Gauss):
For sums of 3 squares r_3(n): write (uniquely) -n=D(2^vf)^2, with D<0 fundamental discriminant, f odd, v>=-1. Then r_3(n) = 12L((D/.),0)(1-(D/2)) Sum_{d | f} mu(d)(D/d)sigma(f/d).
Here mu is the Moebius function, (D/2) and (D/d) are Kronecker-Legendre symbols, sigma is the sum of divisors function, L((D/.),0)=h(D)/(w(D)/2) is the value at 0 of the L function of the quadratic character (D/.), equal to the class number h(D) divided by 2 or 3 in the special cases D=-4 and -3. - Henri Cohen (Henri.Cohen(AT)math.u-bordeaux1.fr), May 12 2010
a(n) = 3*T(n) if n == 1,2,5,6 mod 8, = 2*T(n) if n == 3 mod 8, = 0 if n == 7 mod 8 and = a(n/4) if n == 0 mod 4, where T(n) = A117726(n). [Moreno-Wagstaff].
"If 12E(n) is the number of representations of n as a sum of three squares, then E(n) = 2F(n) - G(n) where G(n) = number of classes of determinant -n, F(n) = number of uneven classes." - Dickson, quoting Kronecker. [Cf. A117726.]
a(n) = Sum_{d^2|n} b(n/d^2), where b() = A074590() gives the number of primitive solutions.
Expansion of phi(q)^3 in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006.
Euler transform of period 4 sequence [ 6, -9, 6, -3, ...]. - Michael Somos, Oct 25 2006
G.f.: (Sum_{k in Z} x^(k^2))^3.
a(8*n + 7) = 0. a(4*n) = a(n).
a(n) = A004015(2*n) = A014455(2*n) = A004013(4*n) = A169783(4*n). a(4*n + 1) = 6 * A045834(n). a(8*n + 3) = 8 * A008443(n). a(8*n + 5) = 24 * A045831(n). - Michael Somos, Jun 03 2012
a(4*n + 2) = 12 * A045828(n). - Michael Somos, Sep 03 2014
a(n) = (-1)^n * A213384(n). - Michael Somos, May 21 2015
a(n) = (6/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
a(n) = A004018(n) + 2*Sum_{k=1..floor(sqrt(n))} A004018(n - k^2). - Daniel Suteu, Aug 27 2021
Convolution cube of A000122. Convolution of A004018 and A000122. - R. J. Mathar, Aug 03 2025

Extensions

More terms from James Sellers, Aug 22 2000

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.

A046895 Sizes of successive clusters in Z^4 lattice.

Original entry on oeis.org

1, 9, 33, 65, 89, 137, 233, 297, 321, 425, 569, 665, 761, 873, 1065, 1257, 1281, 1425, 1737, 1897, 2041, 2297, 2585, 2777, 2873, 3121, 3457, 3777, 3969, 4209, 4785, 5041, 5065, 5449, 5881, 6265, 6577, 6881, 7361, 7809, 7953, 8289, 9057
Offset: 0

Views

Author

Keywords

Comments

Number of lattice points inside or on the 4-sphere x^2 + y^2 + z^2 + u^2 = n. - T. D. Noe, Mar 14 2009

Crossrefs

Partial sums of A000118.

Programs

  • Mathematica
    Accumulate[ Table[ SquaresR[4, n], {n, 0, 42}]] (* Jean-François Alcover, May 11 2012 *)
    QP = QPochhammer; s = (QP[q^2]^5/(QP[q]^2*QP[q^4]^2))^4/(1-q) + O[q]^50; CoefficientList[s, q] (* Jean-François Alcover, Nov 25 2015, after Joerg Arndt *)
  • PARI
    q='q+O('q^66);
    Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^4/(1-q))
    /* Joerg Arndt, Apr 08 2013 */
    
  • Python
    from math import isqrt
    def A046895(n): return 1+((-(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))&-1)<<2)+(((t:=isqrt(m:=n>>2))**2*(t+1)-sum((q:=m//k)*((k<<1)+q+1) for k in range(1,t+1))&-1)<<4) # Chai Wah Wu, Jun 21 2024

Formula

a(n) = A122510(4,n). a(n^2) = A055410(n). - R. J. Mathar, Apr 21 2010
G.f.: T3(q)^4/(1-q) where T3(q) = 1 + 2*Sum_{k>=1} q^(k^2). - Joerg Arndt, Apr 08 2013
Pi^2/2 * (sqrt(n)-1)^4 < a(n) < Pi^2/2 * (sqrt(n)+1)^4 for n > 0. - Charles R Greathouse IV, Feb 17 2015
a(n) = Pi^2/2 * n^2 + O(n (log n)^(2/3)) using a result of Walfisz. - Charles R Greathouse IV, Feb 18 2015
a(n) = 1 + 8*A024916(n) - 32*A024916(floor(n/4)) by Jacobi's four-square theorem. - Peter J. Taylor, Jun 03 2020

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

Original entry on oeis.org

1, 4, 7, 8, 11, 17, 20, 20, 23, 29, 35, 38, 39, 45, 51, 51, 54, 63, 69, 72, 78, 84, 87, 87, 90, 99, 111, 115, 115, 127, 133, 133, 136, 142, 151, 157, 163, 169, 178, 178, 184, 199, 205, 208, 211, 223, 229, 229, 230, 239, 254, 260, 266, 278, 290, 290, 296
Offset: 0

Views

Author

Keywords

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

Cf. A002102 (first differences).

Programs

  • Mathematica
    nn = 50; t = Table[0, {nn}]; Do[d = x^2 + y^2 + z^2; If[0 < d <= nn, t[[d]]++], {x, 0, nn}, {y, 0, nn}, {z, 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
            for z in range(99):
                sz = sy + z*z
                if sz > n: break
                k += 1
      print(str(k), end=',')
    # Alex Ratushnyak, Apr 01 2013

Formula

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

Extensions

More terms from Sean A. Irvine, Dec 01 2010

A000605 Number of points of norm <= n in cubic lattice.

Original entry on oeis.org

1, 7, 33, 123, 257, 515, 925, 1419, 2109, 3071, 4169, 5575, 7153, 9171, 11513, 14147, 17077, 20479, 24405, 28671, 33401, 38911, 44473, 50883, 57777, 65267, 73525, 82519, 91965, 101943, 113081, 124487, 137065, 150555, 164517, 179579, 195269, 212095
Offset: 0

Views

Author

Keywords

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • 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=3 of A302997.
Cf. A117609 (number of lattice points inside the ball x^2+y^2+z^2 <= n).

Programs

  • C
    int A000605(int i)
    {
        const int ring = i*i;
        int result = 0;
        for (int a = -i; a <= i; a++)
            for (int b = -i; b <= i; b++)
                for (int c = -i; c <= i; c++)
                    if ( ring >= a*a+b*b+c*c )  result++;
        return result;
    } /* Oskar Wieland, Apr 08 2013 */
    
  • Mathematica
    Table[Sum[SquaresR[3, k], {k, 0, n^2}], {n, 0, 37}]
  • PARI
    N=66;  q='q+O('q^(N^2));
    t=Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^3/(1-q));  /* A117609 */
    vector(sqrtint(#t),n,t[(n-1)^2+1])
    /* Joerg Arndt, Apr 08 2013 */

Formula

a(n) = A117609(n^2). - R. J. Mathar, Apr 21 2010
a(n) = [x^(n^2)] theta_3(x)^3/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018

Extensions

More terms from David W. Wilson, May 22 2000

A000092 Let A(n) = #{(i,j,k): i^2 + j^2 + k^2 <= n}, V(n) = (4/3)Pi*n^(3/2), P(n) = A(n) - V(n); sequence gives values of n where |P(n)| sets a new record.

Original entry on oeis.org

1, 2, 5, 6, 14, 21, 29, 30, 54, 90, 134, 155, 174, 230, 234, 251, 270, 342, 374, 461, 494, 550, 666, 750, 810, 990, 1890, 2070, 2486, 2757, 2966, 3150, 3566, 3630, 4554, 4829, 5670, 5750, 8154, 8382, 8774, 8910, 10350, 10710, 15734, 15750, 16302, 17550
Offset: 1

Views

Author

Keywords

Comments

Indices n for which A210641(n) = A117609(n) - A210639(n) yields record values (in absolute value). - M. F. Hasler, Mar 26 2012

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
    P[n_] := Sum[SquaresR[3, k], {k, 0, n}] - Round[(4/3)*Pi*n^(3/2)]; record = 0; A000092 = Reap[For[n=1, n <= 2*10^4, n++, If[(p = Abs[P[n]]) > record, record = p; Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Feb 04 2016, after M. F. Hasler *)
  • PARI
    m=0; for(n=1,1e4, if(m+0A210641(n)),m),print1(n",")))  /* Start with n=0 to print the initial 0. */ \\ M. F. Hasler, Mar 26 2012

Extensions

Revised Jun 28 2005

A000223 Let A(n) = #{(i,j,k): i^2 + j^2 + k^2 <= n}, V(n) = (4/3)Pi*n^(3/2), P(n) = A(n) - V(n); A000092 gives values of n where |P(n)| sets a new record; sequence gives (nearest integer to, I believe) P(A000092(n)).

Original entry on oeis.org

3, 7, 10, 19, 32, 34, 37, 51, 81, 119, 122, 134, 157, 160, 161, 174, 221, 252, 254, 294, 305, 309, 364, 371, 405, 580, 682, 734, 756, 763, 776, 959, 1028, 1105, 1120, 1170, 1205, 1550, 1570, 1576, 1851, 1930, 2028, 2404, 2411, 2565, 2675, 2895, 2905, 2940, 3133, 3211, 3240, 3428
Offset: 1

Views

Author

Keywords

Comments

Record values of (absolute values of) A210641 = A117609-A210639. It appears that the records occur always at positive elements of that sequence. (One could add an initial a(0)=1.) - M. F. Hasler, Mar 26 2012

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 = 3*10^4; P[n_] := Sum[SquaresR[3, k], {k, 0, n}] - Round[(4/3)*Pi* n^(3/2)]; record = 0; A000223 = Reap[For[n = 1, n <= nmax, n++, If[(p = Abs[pn = P[n]]) > record, record = p; Print[pn]; Sow[pn]]]][[2, 1]] (* Jean-François Alcover, Feb 05 2016 *)
  • PARI
    m=0;for(n=0,1e4, mA210641(n)) & print1(m=A210641(n)",")) /* This would print a negative value in case the record in absolute value occured for A117609(n)<A210639(n), which does not happen for n<10^4. */ \\ M. F. Hasler, Mar 26 2012

Formula

a(n) = |A210641(A000092(n))|. - M. F. Hasler, Mar 26 2012

Extensions

Revised Jun 28 2005

A341397 Number of integer solutions to (x_1)^2 + (x_2)^2 + ... + (x_8)^2 <= n.

Original entry on oeis.org

1, 17, 129, 577, 1713, 3729, 6865, 12369, 21697, 33809, 47921, 69233, 101041, 136209, 174737, 231185, 306049, 384673, 469457, 579217, 722353, 876465, 1025649, 1220337, 1481521, 1733537, 1979713, 2306753, 2697537, 3087777, 3482913, 3959585, 4558737, 5155473
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 10 2021

Keywords

Comments

Partial sums of A000143.

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n=0, 1, `if`(n<0 or k<1, 0,
          b(n, k-1)+2*add(b(n-j^2, k-1), j=1..isqrt(n))))
        end:
    a:= proc(n) option remember; b(n, 8)+`if`(n>0, a(n-1), 0) end:
    seq(a(n), n=0..33);  # Alois P. Heinz, Feb 10 2021
  • Mathematica
    nmax = 33; CoefficientList[Series[EllipticTheta[3, 0, x]^8/(1 - x), {x, 0, nmax}], x]
    Table[SquaresR[8, n], {n, 0, 33}] // Accumulate
  • Python
    from math import prod
    from sympy import factorint
    def A341397(n): return (sum((prod((p**(3*(e+1))-(1 if p&1 else 15))//(p**3-1) for p, e in factorint(m).items()) for m in range(1,n+1)))<<4)+1 # Chai Wah Wu, Jun 21 2024

Formula

G.f.: theta_3(x)^8 / (1 - x).
a(n^2) = A055414(n).

A342561 List points (x,y,z) having integer coordinates, sorted first by R^2 = x^2 + y^2 + z^2 and in case of ties, then by z and last by polar angle 0 <= phi < 2*Pi in a polar coordinate system. Sequence gives x-coordinates.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Apr 27 2021

Keywords

Comments

This is a 3-dimensional generalization of A305575 and A305576.
y-coordinates are in A342562, z-coordinates are in A342563.
These lists can be read as an irregular table, where row r lists the respective coordinates of the points on the sphere with radius R = sqrt(r); their number (i.e., the row length) is given by A005875 = (1, 6, 12, 8, 6, 24, 24, 0, 12, 30, ...). - M. F. Hasler, Apr 27 2021

Examples

			   n    x    y    z  R^2  phi/Pi
   0    0    0    0   0   0.000
   1    0    0   -1   1   0.000
   2    1    0    0   1   0.000
   3    0    1    0   1   0.500
   4   -1    0    0   1   1.000
   5    0   -1    0   1   1.500
   6    0    0    1   1   0.000
   7    1    0   -1   2   0.000
   8    0    1   -1   2   0.500
   9   -1    0   -1   2   1.000
  10    0   -1   -1   2   1.500
  11    1    1    0   2   0.250
  12   -1    1    0   2   0.750
  13   -1   -1    0   2   1.250
  14    1   -1    0   2   1.750
  15    1    0    1   2   0.000
  16    0    1    1   2   0.500
  17   -1    0    1   2   1.000
  18    0   -1    1   2   1.500
  19    1    1   -1   3   0.250
  20   -1    1   -1   3   0.750
  21   -1   -1   -1   3   1.250
  22    1   -1   -1   3   1.750
  23    1    1    1   3   0.250
  24   -1    1    1   3   0.750
  25   -1   -1    1   3   1.250
  26    1   -1    1   3   1.750
  27    0    0   -2   4   0.000
  28    2    0    0   4   0.000
  29    0    2    0   4   0.500
		

Crossrefs

Cf. A343630, A340631, A340632, A343633 for a variant which "connects" corresponding poles of successive shells, A343640, A340641, A340642, A343643 for a square spiral variant.

Programs

  • PARI
    shell(n, Q=Qfb(1,0,1), L=List())={for(z=if(n, sqrtint((n-1)\3)+1), sqrtint(n), my(S=if(n>z^2, Set(apply(vecsort, abs(qfbsolve(Q, n-z^2, 3)))), [[0,0]])); foreach(S, s, forperm(concat(s,z), p, listput(L, p)))); for(i=1,3, for(j=1,#L, my(X=L[j]); (X[i]*=-1) && listput(L,X))); vecsort(L, (p,q)->if( p[3]!=q[3], p[3]-q[3], p[1]==q[1], q[2]-p[2], p[2]*q[2]<0, q[2]-p[2], (q[1]-p[1])*(p[2]+q[2])))} \\ Gives list of all points with Euclidean norm sqrt(n).
    A342561_vec=concat([[P[1] | P <- shell(n)] | n<-[0..7]]) \\ M. F. Hasler, Apr 27 2021
Showing 1-10 of 22 results. Next