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.

A066806 Expansion of Product_{k>=1} (1+x^k)^A001055(k).

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 6, 8, 11, 16, 21, 27, 38, 49, 63, 84, 109, 138, 180, 228, 289, 369, 463, 578, 732, 911, 1128, 1407, 1741, 2140, 2646, 3243, 3968, 4862, 5925, 7198, 8770, 10620, 12833, 15524, 18718, 22502, 27075, 32467, 38873, 46537, 55565, 66220, 78946
Offset: 0

Views

Author

Vladeta Jovovic, Jan 19 2002

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory):
    g:= proc(n, k) option remember; `if`(n>k, 0, 1)+
          `if`(isprime(n), 0, add(`if`(d>k, 0, g(n/d, d)),
             d=divisors(n) minus {1, n}))
        end:
    b:= proc(n) b(n):= add((-1)^(n/d+1)*d*g(d$2), d=divisors(n)) end:
    a:= proc(n) a(n):= `if`(n=0, 1, add(a(n-k)*b(k), k=1..n)/n) end:
    seq(a(n), n=0..60);  # Alois P. Heinz, May 16 2014
  • Mathematica
    g[n_, k_] := g[n, k] = If[n > k, 0, 1] + If[PrimeQ[n], 0, Sum[If[d > k, 0, g[n/d, d]], {d, Divisors[n] ~Complement~ {1, n}}]];
    b[n_] := b[n] = Sum[(-1)^(n/d + 1)*d*g[d, d], {d, Divisors[n]}];
    a[n_] := a[n] = If[n == 0, 1, Sum[a[n - k]*b[k], {k, 1, n}]/n];
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Mar 23 2017, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import divisors, isprime
    @cacheit
    def g(n, k): return (0 if n>k else 1) + (0 if isprime(n) else sum(0 if d>k else g(n//d, d) for d in divisors(n)[1:-1]))
    @cacheit
    def b(n): return sum((-1)**(n//d + 1)*d*g(d, d) for d in divisors(n))
    @cacheit
    def a(n): return 1 if n==0 else sum(a(n - k)*b(k) for k in range(1, n + 1))//n
    print([a(n) for n in range(61)]) # Indranil Ghosh, Aug 19 2017, after Maple code

Formula

a(n) = (1/n)*Sum_{k=1..n} a(n-k)*b(k), n>0, a(0)=1, b(k)=Sum_{d|k} (-1)^(n/d+1)*d*A001055(d).