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”).
%I #34 Jul 16 2021 06:45:36
%S 3,4,30,12,0,120,1260,840,0,2520,0,27720,0,0,6126120,720720,0,
%T 12252240,0,0,0,232792560,0,5354228880,0,26771144400,0,80313433200,0,
%U 4658179125600,72201776446800,0,0,0,0,144403552893600,0,0,0,5342931457063200,0
%N Smallest number divisible by all numbers 1 through n+1 except n, or 0 if impossible.
%C a(n) = 0 for all n in A024619.
%C 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
%C 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
%H Jon E. Schoenfield, <a href="/A345022/b345022.txt">Table of n, a(n) for n = 2..2310</a>
%F 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
%e a(5)=12 because 12 is divisible by 1, 2, 3, 4, and 6; but not 5.
%e 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.
%t Table[If[Mod[l=LCM@@Join[Range[n-1],{n+1}],n]==0,0,l],{n,2,50}] (* _Giorgos Kalogeropoulos_, Jun 25 2021 *)
%o (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
%o (Python) # generates initial segment of sequence
%o from math import gcd
%o from itertools import accumulate
%o def lcm(a, b): return a * b // gcd(a, b)
%o def aupton(nn):
%o lcm1 = accumulate(range(1, nn), lcm)
%o lcm2 = [lcm(k, n+1) for n, k in enumerate(lcm1, start=2)]
%o return [m*(m%n != 0) for n, m in enumerate(lcm2, start=2)]
%o print(aupton(42)) # _Michael S. Branicky_, Jun 25 2021
%Y Cf. A024619, A003418.
%K nonn
%O 2,1
%A _J. Lowell_, Jun 05 2021
%E a(16)-a(42) from _Jon E. Schoenfield_, Jun 05 2021