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”).

A368777
a(n) is the largest divisor of n that is a term of the sequence A003418, the least common multiple of the first k natural numbers.
2
1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 12, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 12, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 12, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 12, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 60, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 12, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 12
OFFSET
1,2
COMMENTS
The graph of this sequence gives it the appearance of a ruler-like function. If n is odd, a(n) = 1. If n is even and not a multiple of 6, a(n) = 2. If n is a multiple of 6 but not of 12, a(n) = 6, and so on.
LINKS
FORMULA
a(n) = A003418(A055874(n))
EXAMPLE
a(18) = 6 as 18 is divisible by lcm(1, 2, 3) = 6 but not by lcm(1, 2, 3, 4) = 12. so 6 is the largest divisor of 18 that is a term of A003418. - David A. Corneth, Jan 28 2024
MATHEMATICA
seq[max_] := Module[{lcms = Table[LCM @@ Range[k], {k, max}]}, Table[Max[Select[Divisors[k], MemberQ[lcms, #] &]], {k, 1, max}]]; seq[100] (* Amiram Eldar, Jan 12 2024 *)
PROG
(PARI) a(n) = for(i = 2, n, if(n%i != 0, return(lcm([1..i-1])))); n \\ David A. Corneth, Jan 27 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hal M. Switkay, Jan 11 2024
STATUS
approved