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.

A039824 Number of different coefficient values in expansion of Product (1+q^1+q^3...+q^(2i-1)), i=1 to n.

Original entry on oeis.org

1, 2, 4, 11, 20, 31, 46, 61, 78, 97, 118, 141, 166, 193, 222, 253, 286, 321, 358, 397, 438, 481, 526, 573, 622, 673, 726, 781, 838, 897, 958, 1021, 1086, 1153, 1222, 1293, 1366, 1441, 1518, 1597, 1678, 1761, 1846, 1933, 2022, 2113, 2206, 2301, 2398, 2497
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A028872.

Programs

  • Mathematica
    p[1] = 1 + q; p[n_] := p[n] = p[n - 1] (1 + Sum[q^k, {k, 1, 2 n - 1, 2}]) // Expand; a[1] = 1; a[n_] := p[n] // CoefficientList[#, q]& // Union // Length; Array[a, 180] (* Jean-François Alcover, May 04 2017 *)
  • Python
    def get(d, x): return d[x] if len(d) > x >= 0 else 0
    def convolve(a, b):
        r = []
        for x in range(len(a) + len(b) - 1):
            n = 0
            for k in range(x + 1): n += get(a, k) * get(b, x - k)
            r.append(n)
        return r
    def unique_in(d):
        out = list([])
        for elem in d:
            if elem not in out: out.append(elem)
        return len(out)
    def A039824(x):
        seed = [0**k + k % 2 for k in range(2*(x+1))]
        product = seed[0:2]
        out = list([1])
        for k in range(2, x + 1):
            product = convolve(product, seed[0:2*k])
            out.append(unique_in(product))
        return out
    # J. Conrad, May 02 2017

Formula

Conjecture: for n>6, a(n) = n^2 - 3. - Ralf Stephan, Mar 07 2004
Conjectures from Colin Barker, May 02 2017: (Start)
G.f.: x*(1 - x + x^2 + 4*x^3 - 3*x^4 + 2*x^6 - 4*x^7 + 2*x^8) / (1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>9.
(End)