login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A345022
Smallest number divisible by all numbers 1 through n+1 except n, or 0 if impossible.
1
3, 4, 30, 12, 0, 120, 1260, 840, 0, 2520, 0, 27720, 0, 0, 6126120, 720720, 0, 12252240, 0, 0, 0, 232792560, 0, 5354228880, 0, 26771144400, 0, 80313433200, 0, 4658179125600, 72201776446800, 0, 0, 0, 0, 144403552893600, 0, 0, 0, 5342931457063200, 0
OFFSET
2,1
COMMENTS
a(n) = 0 for all n in A024619.
a(n) > a(n+1) > 0 iff n > 2 and n is a power of 2 and n+1 is a prime or prime power. Does this occur only for n in {4, 8, 16, 256, 65536}? - Jon E. Schoenfield, Jun 07 2021
Probably yes. Those are the Fermat numbers minus 1 and the number 8 (which is the only power of 2 that is one less than a square number). - J. Lowell, Jun 08 2021
LINKS
FORMULA
a(n) = 0 if n divides f(n), f(n) otherwise, where f(n) = lcm(A003418(n-1), n+1). - Jon E. Schoenfield, Jun 05 2021
EXAMPLE
a(5)=12 because 12 is divisible by 1, 2, 3, 4, and 6; but not 5.
a(6)=0 because it's impossible for a number to be divisible by 1, 2, 3, 4, 5, and 7; but not 6. Any number divisible by both 2 and 3 is also divisible by 6.
MATHEMATICA
Table[If[Mod[l=LCM@@Join[Range[n-1], {n+1}], n]==0, 0, l], {n, 2, 50}] (* Giorgos Kalogeropoulos, Jun 25 2021 *)
PROG
(Magma) a:=[]; L:=1; for n in [2..42] do t:=Lcm(L, n+1); if t mod n eq 0 then a[n-1]:=0; else a[n-1]:=t; end if; L:=Lcm(L, n); end for; a; // Jon E. Schoenfield, Jun 05 2021
(Python) # generates initial segment of sequence
from math import gcd
from itertools import accumulate
def lcm(a, b): return a * b // gcd(a, b)
def aupton(nn):
lcm1 = accumulate(range(1, nn), lcm)
lcm2 = [lcm(k, n+1) for n, k in enumerate(lcm1, start=2)]
return [m*(m%n != 0) for n, m in enumerate(lcm2, start=2)]
print(aupton(42)) # Michael S. Branicky, Jun 25 2021
CROSSREFS
Sequence in context: A226049 A354844 A100600 * A288868 A076001 A225629
KEYWORD
nonn
AUTHOR
J. Lowell, Jun 05 2021
EXTENSIONS
a(16)-a(42) from Jon E. Schoenfield, Jun 05 2021
STATUS
approved