OFFSET
0,2
COMMENTS
FORMULA
PROG
(SageMath)
from functools import cache
@cache
def a_rec(n):
if n == 0: return 1
p = mul(s for s in map(lambda i: i + 2, divisors(n)) if is_prime(s))
return p * a_rec(n - 1)
print([a_rec(n) for n in range(21)])
# Alternatively, but less efficient:
def a(n): return (2**(n%2 - n) * lcm(product(r + 2 for r in p) for p in Partitions(n)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Dec 12 2023
STATUS
approved