OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..335
Wikipedia, Gödel's encoding
EXAMPLE
The compositions of 3 and their encodings are [1,1,1]-> 30, [1,2]-> 18, [2,1]-> 12, [3]-> 8. The sum gives a(3) = 68.
MAPLE
b:= proc(n, j) option remember; `if`(n=0, 1,
add(ithprime(j)^i*b(n-i, j+1), i=1..n))
end:
a:= n-> b(n, 1):
seq(a(n), n=0..20); # Alois P. Heinz, Sep 04 2019
MATHEMATICA
b[n_, j_] := b[n, j] = If[n==0, 1, Sum[Prime[j]^i*b[n-i, j+1], {i, 1, n}]];
a[n_] := b[n, 1];
a /@ Range[0, 20] (* Jean-François Alcover, Apr 23 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 04 2019
STATUS
approved