OFFSET
1,3
COMMENTS
a(n) = 1 if and only if n is a power of 2.
a(n) = 2 if and only if n is an odd prime.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(2n-1) = A000005(2n-1).
EXAMPLE
For n = 10 the divisors of 10 are [1, 2, 5, 10] and the largest odd divisor is 5 and 5 is the third divisor, so a(10) = 3.
MATHEMATICA
a[n_] := If[OddQ[n], DivisorSigma[0, n], FirstPosition[Divisors[n], n/2^IntegerExponent[n, 2]][[1]]]; Array[a, 100] (* Amiram Eldar, May 14 2025 *)
PROG
(PARI) a(n) = select(x->x==n/2^valuation(n, 2), divisors(n), 1)[1]; \\ Michel Marcus, May 14 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, May 14 2025
STATUS
approved
