OFFSET
1,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..25200
EXAMPLE
a(24) = 3 because the divisors of 24 are (1, 2, 3, 4, 6, 8, 12, 24) and from the fourth divisor onwards, d_i is divisible by 2 > 1 but d_3 = 3 is not so a(24) = 3.
MATHEMATICA
Array[LengthWhile[#, # == 1 &] &@ Reverse@ FoldList[GCD[#1, #2] &, Reverse@ Divisors@ #] &, 105] (* Michael De Vlieger, Dec 31 2018 *)
PROG
(PARI) a(n) = my(d=divisors(n), start = max(1, #d-1), g=d[start], i=start); while(g>1, start--; g=gcd(g, d[start])); start
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, Dec 09 2018
STATUS
approved