OFFSET
2,3
COMMENTS
a(n) is always a positive integer: if d_{i+1}/d_i is the maximal ratio of consecutive divisors, then a(n) = (n/d_{i+1})*d_i, which is an integer since d_{i+1} divides n.
FORMULA
a(n) = n / max_i (d_{i+1}/d_i), where 1 = d_1 < ... < d_t = n are the divisors of n.
a(p) = 1 for prime p.
For squarefree n = p_1*p_2*...*p_k with p_1 < ... < p_k, a(n) = min_{0<=j<=k-1} (n/p_{j+1}) * Product_{i=1..j} p_i.
EXAMPLE
For n = 10 the divisors are 1, 2, 5, 10, with consecutive ratios 2, 5/2, 2; the largest is 5/2, so a(10) = 10/(5/2) = 4.
For n = 12 the divisors are 1, 2, 3, 4, 6, 12, with largest consecutive ratio 2, so a(12) = 12/2 = 6.
MATHEMATICA
a[n_]:=With[{d=Divisors[n]}, n/Max[Rest[d]/Most[d]]]; Array[a, 80, 2]
PROG
(PARI) a(n)=my(d=divisors(n)); n/vecmax(vector(#d-1, i, d[i+1]/d[i]));
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eric Fodge, Jun 09 2026
STATUS
approved
