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.

A055410 Number of points in Z^4 of norm <= n.

Original entry on oeis.org

1, 9, 89, 425, 1281, 3121, 6577, 11833, 20185, 32633, 49689, 72465, 102353, 140945, 190121, 250553, 323721, 411913, 519025, 643441, 789905, 961721, 1156217, 1380729, 1638241, 1927297, 2257281, 2624417, 3035033, 3490601, 4000425
Offset: 0

Views

Author

Keywords

Crossrefs

Column k=4 of A302997.
Cf. A046895 (sizes of successive clusters in Z^4 lattice).

Programs

  • C
    int A055410(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++)
                    for(int d = -i; d <= i; d++)
                        if ( ring >= a*a + b*b + c*c + d*d ) result++;
        return result;
    } /* Oskar Wieland, Apr 08 2013 */
    
  • Mathematica
    a[n_] := SeriesCoefficient[EllipticTheta[3, 0, x]^4/(1 - x), {x, 0, n^2}];
    a /@ Range[0, 30] (* Jean-François Alcover, Sep 23 2019, after Ilya Gutkovskiy *)
  • PARI
    N=66;  q='q+O('q^(N^2));
    t=Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^4/(1-q)); /* A046895 */
    vector(sqrtint(#t),n,t[(n-1)^2+1])
    /* Joerg Arndt, Apr 08 2013 */
    
  • Python
    from math import isqrt
    def A055410(n): return 1+((-(s:=n**2)*(n+1)+sum((q:=s//k)*((k<<1)+q+1) for k in range(1,n+1))&-1)<<2)+(((t:=isqrt(m:=s>>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 24 2024

Formula

a(n) = A046895(n^2). - Joerg Arndt, Apr 08 2013
a(n) = [x^(n^2)] theta_3(x)^4/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018