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