OFFSET
0,5
LINKS
OEIS Wiki, Euler transform
FORMULA
a(n) ~ 3^(n + 1/2) / (4*sqrt(Pi)*n^(3/2)). - Vaclav Kotesovec, Jun 15 2024
MAPLE
EulerInvTransform := proc(f) local c, b;
c := proc(n) option remember;
ifelse(n = 0, f(0), f(n) - b(n, n-1)) end:
b := proc(n, k) option remember;
if n = 0 then return 1 elif k < 1 then return 0 fi;
add(binomial(c(k) + j - 1, j)*b(n-k*j, k-1), j=0..n/k) end:
c end:
a := EulerInvTransform(A005043): seq(a(n), n = 0..32);
MATHEMATICA
EulerInvTransform[seq_List] := Module[{final = {}}, Do[AppendTo[final, i*seq[[i]] - Sum[final[[d]]*seq[[i-d]], {d, i-1}]], {i, Length[seq]}]; Table[Sum[MoebiusMu[i/d]*final[[d]], {d, Divisors[i]}]/i, {i, Length[seq] }]];
Join[{1}, EulerInvTransform[Array[A005043, 32]]] (* Jean-François Alcover, Jun 15 2024 *)
PROG
(SageMath)
z = PowerSeriesRing(ZZ, 'z').gen().O(33)
g = 1 + z + sqrt(1 - 2*z - 3*z**2)
f = -z * g.derivative() / g
print([1] + [sum(moebius(n // d) * f[d]
for d in divisors(n)) // n for n in range(1, 33)])
(Python)
from typing import Callable
from functools import cache
from math import comb
# Define 'binomial' for compatibility with Maple.
def binomial(n: int, k: int) -> int:
if 0 <= k <= n: return comb(n, k)
if k <= n < 0: return comb(-k-1, n-k)*(-1)**(n-k)
if n < 0 <= k: return comb(-n+k-1, k)*(-1)**k
return 0
def EulerInvTransform(f: Callable) -> Callable:
@cache
def h(n: int, k: int) -> int:
if n == 0: return 1
if k < 1: return 0
return sum(binomial(b(k)+j-1, j) * h(n-k*j, k-1)
for j in range(1 + n // k))
@cache
def b(n: int) -> int:
if n == 0: return f(0)
return f(n) - h(n, n - 1)
return b
a = EulerInvTransform(A005043)
print([a(n) for n in range(33)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 20 2022
STATUS
approved