OFFSET
0,3
FORMULA
a(n) = lcm_{k=0..n-1} a(n-1 - k) + k with a(0)=1.
EXAMPLE
Prepend a(n-1)
after incrementing the value
in each of these columns
| | | |
v v v v
n=0: 1 = a(0),
n=1: lcm( a(0) ) = lcm( 1) = 1 = a(1),
n=2: lcm( a(1), a(0)+1) = lcm( 1,2) = 2 = a(2),
n=3: lcm( a(2), a(1)+1, a(0)+2) = lcm( 2,2,3) = 6 = a(3),
n=4: lcm(a(3), a(2)+1, a(1)+2, a(0)+3) = lcm(6,3,3,4) = 12 = a(4).
PROG
(Python)
import math
def a(n):
p=[1]
for i in range(n):
p.append(math.lcm(*p))
for x in range(0, len(p)-1):
p[x]+=1
return p[-1]
CROSSREFS
KEYWORD
nonn
AUTHOR
Justin Dugan, Nov 13 2023
STATUS
approved