A383401 Index of the largest odd divisor in the list of divisors of n.
1, 1, 2, 1, 2, 3, 2, 1, 3, 3, 2, 3, 2, 3, 4, 1, 2, 5, 2, 4, 4, 3, 2, 3, 3, 3, 4, 4, 2, 7, 2, 1, 4, 3, 4, 6, 2, 3, 4, 4, 2, 7, 2, 4, 6, 3, 2, 3, 3, 5, 4, 4, 2, 7, 4, 4, 4, 3, 2, 9, 2, 3, 6, 1, 4, 7, 2, 4, 4, 7, 2, 7, 2, 3, 6, 4, 4, 7, 2, 4, 5, 3, 2, 9, 4, 3, 4, 5, 2, 11, 4, 4, 4, 3, 4, 3, 2, 5, 6, 7
Offset: 1
Examples
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.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
PARI
a(n) = select(x->x==n/2^valuation(n,2), divisors(n), 1)[1]; \\ Michel Marcus, May 14 2025
Formula
a(2n-1) = A000005(2n-1).
Comments