cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A383401 Index of the largest odd divisor in the list of divisors of n.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, May 14 2025

Keywords

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.

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.
		

Crossrefs

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).