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.

A361565 a(n) is the numerator of the median of divisors of n.

Original entry on oeis.org

1, 3, 2, 2, 3, 5, 4, 3, 3, 7, 6, 7, 7, 9, 4, 4, 9, 9, 10, 9, 5, 13, 12, 5, 5, 15, 6, 11, 15, 11, 16, 6, 7, 19, 6, 6, 19, 21, 8, 13, 21, 13, 22, 15, 7, 25, 24, 7, 7, 15, 10, 17, 27, 15, 8, 15, 11, 31, 30, 8, 31, 33, 8, 8, 9, 17, 34, 21, 13, 17, 36, 17, 37, 39, 10
Offset: 1

Views

Author

Stefano Spezia, Mar 15 2023

Keywords

Examples

			a(9) = 3 since the divisors of 9 are 1, 3, 9, and their median is 3.
a(12) = 7 since the divisors of 12 are 1, 2, 3, 4, 6, 12, and their median is 7/2.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Numerator[Median[Divisors[n]]]; Array[a,75]
  • PARI
    a(n) = my(d=divisors(n), m=#d+1); numerator((d[m\2] + d[m-m\2])/2); \\ Michel Marcus, Mar 16 2023

Formula

a(n) = numerator((A033676(n) + A033677(n))/2).
a(p) = (1 + p)/2 if p is an odd prime.
For p a prime, a(p^k) = (p^((k-1)/2) + p^((k+1)/2))/2 if k is odd, a(p^k) = p^(k/2) if k is even.