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.

A369790 Number of different coefficient values in expansion of Product_{k=1..n} (1-x^k)^3.

Original entry on oeis.org

1, 4, 5, 15, 13, 31, 26, 57, 42, 91, 66, 139, 95, 209, 129, 283, 171, 365, 216, 463, 272, 573, 333, 697, 401, 825, 468, 993, 545, 1139, 629, 1315, 725, 1509, 815, 1689, 920, 1921, 1030, 2139, 1147, 2367, 1261, 2619, 1391, 2861, 1521, 3135, 1659, 3409, 1802, 3703, 1952
Offset: 0

Views

Author

Seiichi Manyama, Feb 01 2024

Keywords

Crossrefs

Programs

  • PARI
    a(n) = #Set(Vec(prod(k=1, n, (1-x^k)^3)));
    
  • Python
    from collections import Counter
    def A369790(n):
        c = {0:1}
        for k in range(1,n+1):
            d = Counter(c)
            for j in c:
                a = c[j]
                d[j+k] -= 3*a
                d[j+2*k] += 3*a
                d[j+3*k] -= a
            c = d
        return len(set(c.values()))+int(max(c)+1>len(c)) # Chai Wah Wu, Feb 01 2024