login
A309233
Lexicographically earliest increasing sequence such that n-th term is divisible by all positive integers up to n.
1
1, 2, 6, 12, 60, 120, 420, 840, 2520, 5040, 27720, 55440, 360360, 720720, 1081080, 1441440, 12252240, 24504480, 232792560, 465585120, 698377680, 931170240, 5354228880, 10708457760, 26771144400, 53542288800, 80313433200, 160626866400, 2329089562800, 4658179125600, 72201776446800
OFFSET
1,2
LINKS
EXAMPLE
The 5th term 60, is divisible by 1,2,3,4, and 5.
The 6th term 120, greater than 60, is divisible by 1,2,3,4,5, and 6.
The 10th term 5040, greater than 2520, is divisible by 1,2,3,4,5,6,7,8,9, and 10.
PROG
(Python)
x = [1] # To count the number in the sequence
y = [1] # To record the sequence itself
N = 20 # The number of terms to calculate
while len(x) < N:
x.append(x[-1] + 1)
# The next number in the sequence will be divisible by x[-1] so start
# looking at z which is the largest number divisible by x[-1] so far
z = y[-1]//x[-1] * x[-1] + x[-1]
# Now start counting up by x[-1] and check if the number is divisible by
# every integer less than x[-1]
while any([z%i != 0 for i in x]):
z += x[-1]
y.append(z)
print("{}\t {}\t".format(len(x), z))
(PARI) A003418(n) = if(n<1, n==0, 1/content(vector(n, k, 1/k)));
a(n) = {my(k=1); if(n>1, k=A003418(n)*(1+a(n-1)\A003418(n))); k} \\ Jinyuan Wang, Jul 22 2019
CROSSREFS
Would be same as A003418 without the "increasing" condition.
Sequence in context: A004490 A224078 A309811 * A135060 A185021 A191836
KEYWORD
nonn
AUTHOR
Rian Rustvold, Jul 16 2019
EXTENSIONS
More terms from Jinyuan Wang, Jul 22 2019
STATUS
approved