OFFSET
1,3
COMMENTS
a(n) = 1 if and only if n is a power of 2.
EXAMPLE
For n = 30 the divisors of 30 are [1, 2, 3, 5, 6, 10, 15, 30] and the largest odd noncomposite divisor is 5 and 5 is its 4th divisor, so a(30) = 4.
MATHEMATICA
a[n_] := Module[{m = n/2^IntegerExponent[n, 2]}, If[m == 1, 1, Position[Divisors[n], FactorInteger[m][[-1, 1]]][[1, 1]]]]; Array[a, 100] (* Amiram Eldar, May 29 2025 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, May 29 2025
STATUS
approved
