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.

A369628 Number of solutions to k_1 + 2*k_2 + ... + n*k_n = 1, where k_i are from {-1,0,1}, i=1..n.

Original entry on oeis.org

0, 1, 2, 3, 6, 15, 36, 85, 213, 549, 1423, 3723, 9882, 26508, 71579, 194533, 532120, 1463561, 4044075, 11221727, 31260192, 87386579, 245058185, 689209348, 1943530845, 5494106583, 15566303698, 44196212866, 125727934145, 358317169828, 1022916667066, 2924843243594
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 28 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Coefficient[Product[(x^k + 1 + 1/x^k), {k, 1, n}], x, 1], {n, 0, 31}]
  • Python
    from itertools import count, islice
    from collections import Counter
    def A369628_gen(): # generator of terms
        ccount = Counter({0:1})
        yield 0
        for i in count(1):
            bcount = Counter(ccount)
            for a in ccount:
                bcount[a+i] += ccount[a]
                bcount[a-i] += ccount[a]
            ccount = bcount
            yield(ccount[1])
    A369628_list = list(islice(A369628_gen(),20)) # Chai Wah Wu, Jan 29 2024

Formula

a(n) = [x^1] Product_{k=1..n} (x^k + 1 + 1/x^k).
a(n) = [x^(n*(n+1)/2+1)] Product_{k=1..n} (1 + x^k + x^(2*k)).