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
Jon E. Schoenfield, Table of n, a(n) for n = 2..2310
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
KEYWORD
nonn
AUTHOR
J. Lowell, Jun 05 2021
EXTENSIONS
a(16)-a(42) from Jon E. Schoenfield, Jun 05 2021
STATUS
approved