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.

A045849 Number of nonnegative solutions of x1^2 + x2^2 + ... + x7^2 = n.

Original entry on oeis.org

1, 7, 21, 35, 42, 63, 112, 141, 126, 154, 259, 315, 280, 308, 462, 567, 497, 462, 693, 910, 798, 749, 1078, 1281, 1092, 1043, 1407, 1715, 1576, 1449, 1946, 2422, 2016, 1687, 2429, 3045, 2604, 2345, 3066
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    (1 + EllipticTheta[3, 0, q])^7/128 + O[q]^50 // CoefficientList[#, q]& (* Jean-François Alcover, Aug 26 2019 *)
  • PARI
    seq(n)=Vec((sum(k=0, sqrtint(n), x^(k^2)) + O(x*x^n))^7) \\ Andrew Howroyd, Aug 08 2018
    
  • Ruby
    def mul(f_ary, b_ary, m)
      s1, s2 = f_ary.size, b_ary.size
      ary = Array.new(s1 + s2 - 1, 0)
      (0..s1 - 1).each{|i|
        (0..s2 - 1).each{|j|
          ary[i + j] += f_ary[i] * b_ary[j]
        }
      }
      ary[0..m]
    end
    def power(ary, n, m)
      if n == 0
        a = Array.new(m + 1, 0)
        a[0] = 1
        return a
      end
      k = power(ary, n >> 1, m)
      k = mul(k, k, m)
      return k if n & 1 == 0
      return mul(k, ary, m)
    end
    def A(k, n)
      ary = Array.new(n + 1, 0)
      (0..Math.sqrt(n).to_i).each{|i| ary[i * i] = 1}
      power(ary, k, n)
    end
    p A(7, 100) # Seiichi Manyama, May 28 2017

Formula

Coefficient of q^n in (1 + q + q^4 + q^9 + q^16 + q^25 + q^36 + q^49 + q^64 + ...)^7.
G.f.: (1 + theta_3(q))^7/128, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Aug 08 2018