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.

Showing 1-4 of 4 results.

A361566 a(n) is the denominator of the median of divisors of n.

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2
Offset: 1

Views

Author

Stefano Spezia, Mar 15 2023

Keywords

Comments

a(n) = 2 if n is in A139710, otherwise a(n) = 1. - Robert Israel, Mar 15 2023

Examples

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

Crossrefs

Programs

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

Formula

a(n) = denominator((A033676(n) + A033677(n))/2).
Except for p = 2 and k = 1, a(p^k) = 1, if p is a prime.

A361632 a(n) is the numerator of the median of the prime factors of n with repetition.

Original entry on oeis.org

2, 3, 2, 5, 5, 7, 2, 3, 7, 11, 2, 13, 9, 4, 2, 17, 3, 19, 2, 5, 13, 23, 2, 5, 15, 3, 2, 29, 3, 31, 2, 7, 19, 6, 5, 37, 21, 8, 2, 41, 3, 43, 2, 3, 25, 47, 2, 7, 5, 10, 2, 53, 3, 8, 2, 11, 31, 59, 5, 61, 33, 3, 2, 9, 3, 67, 2, 13, 5, 71, 2, 73, 39, 5, 2, 9, 3, 79
Offset: 2

Views

Author

Stefano Spezia, Mar 18 2023

Keywords

Examples

			a(12) = 2 since 12 = 2*2*3, and the median of the factors is equal to 2.
a(36) = 5 since 30 = 2*2*3*3, and the median of the factors is equal to 5/2.
		

Crossrefs

Cf. A001222, A027746, A079879, A323171, A361565, A361630 (without repetition), A361633 (denominator), A361725.

Programs

  • Mathematica
    a[n_]:=Numerator[Median[Flatten[Table[#[[1]], {#[[2]]}] & /@ FactorInteger[n]]]]; Array[a,78,2]

Formula

For p a prime, a(p^k) = p.
a(n) = numerator((A079879(n) + A361725(n))/2).

A377499 a(n) is the median of the divisors of 2n-1.

Original entry on oeis.org

1, 2, 3, 4, 3, 6, 7, 4, 9, 10, 5, 12, 5, 6, 15, 16, 7, 6, 19, 8, 21, 22, 7, 24, 7, 10, 27, 8, 11, 30, 31, 8, 9, 34, 13, 36, 37, 10, 9, 40, 9, 42, 11, 16, 45, 10, 17, 12, 49, 10, 51, 52, 11, 54, 55, 20, 57, 14, 11, 12, 11, 22, 15, 64, 23, 66, 13, 12, 69, 70, 25, 12, 17, 14, 75, 76
Offset: 1

Views

Author

Charles Kusniec, Oct 30 2024

Keywords

Comments

From Rémi Guillaume, Nov 26 2024 and Dec 05 2024: (Start)
2n-1 has only odd divisors; so the sum of any two of them is even.
a(n) and A219695(n) have opposite parity.
a(n) and n have the same parity.
a(n) = sqrt(2n-1) iff 2n-1 = (2j+1)^2 for some j >= 0, iff n is a centered square (A001844(j)); in this case, the two "median" divisors coincide with 2j+1, so their mean a(n) = 2j+1 and A219695(n) = 0.
More generally, with s a nonnegative integer:
If j >= s and n is the centered square A001844(j), then a(n-2s^2) <= 2j+1 and A219695(n-2s^2) <= 2s.
If j > (s^2)/2 and n = A001844(j), then a(n-2s^2) = 2j+1 and A219695(n-2s^2) = 2s. (P)
Basis of the proofs: 2(n-2s^2)-1 = (2j+1)^2-(2s)^2.
If j = s and n = A001844(j), then n-2s^2 = 2j+1 and 2(n-2s^2)-1 = 4j+1.
(End)

Examples

			From _Michael De Vlieger_, Nov 01 2024: (Start)
Let u = 2*n-1, let factor d <= sqrt(u) be the largest such, and let D = u/d.
For n = 2, u = 2*2-1 = 3, d = 1, D = 3, so a(2) = (1+3)/2 = 2.
For n = 5, u = 2*5-1 = 9 is a perfect square and d = D = 3, so a(5) = (3+3)/2 = 3.
For n = 8, u = 2*8-1 = 15, d = 3, D = 5, so a(8) = (3+5)/2 = 4, etc. (End)
		

Crossrefs

Cf. A219695 (associated subtrahend square base forming 2n-1), A001844 (solutions of a(n)=sqrt(2n-1)), A006254 (indices of record highs).

Programs

  • Mathematica
    {1}~Join~Table[u = 2*n + 1; (# + u/#)/2 &@ #[[Floor[Length[#]/2] ]] &@ Divisors[u], {n, 2, 120}] (* Michael De Vlieger, Nov 01 2024 *)
  • Python
    from sympy import divisors
    def A377499(n): return (d:=(f:=divisors(m:=(n<<1)-1))[len(f)-1>>1])+m//d>>1 # Chai Wah Wu, Nov 07 2024

Formula

a(n) = (A033677(2n-1) + A033676(2n-1))/2.
a(n) = A063655(2n-1)/2.
a(n) = sqrt((2n-1) + A219695(n)^2).
a(n) = n iff 2n-1 is 1 or prime (n is 1 or in A006254); in this case, A219695(n) = n-1.
From Rémi Guillaume, Nov 21 2024: (Start)
a(n) = A361565(2n-1).
sqrt(2n-1) <= a(n) <= n.
a(n) = (A377865(n) + A377864(n))/2.
a(n) = A377864(n) + A219695(n).
a(n) = A377865(n) - A219695(n). (End)

Extensions

New name from Rémi Guillaume, Feb 19 2025

A361630 a(n) is the numerator of the median of the distinct prime factors of n.

Original entry on oeis.org

2, 3, 2, 5, 5, 7, 2, 3, 7, 11, 5, 13, 9, 4, 2, 17, 5, 19, 7, 5, 13, 23, 5, 5, 15, 3, 9, 29, 3, 31, 2, 7, 19, 6, 5, 37, 21, 8, 7, 41, 3, 43, 13, 4, 25, 47, 5, 7, 7, 10, 15, 53, 5, 8, 9, 11, 31, 59, 3, 61, 33, 5, 2, 9, 3, 67, 19, 13, 5, 71, 5, 73, 39, 4, 21, 9, 3
Offset: 2

Views

Author

Stefano Spezia, Mar 18 2023

Keywords

Examples

			a(12) = 5 since the distinct prime factors of 12 are 2 and 3, of median equal to 5/2.
a(30) = 3 since the distinct prime factors of 30 are 2, 3, and 5, of median equal to 3.
		

Crossrefs

Cf. A001221, A027748, A323171, A361565, A361631 (denominator), A361632 (with multiplicity).

Programs

  • Mathematica
    a[n_]:=Numerator[Median[FactorInteger[n][[All, 1]]]]; Array[a,77,2]
  • PARI
    a(n)=my(f=factor(n)[,1]~, i=length(f)); numerator(if(i%2, f[i\2+1], (f[i/2]+f[i/2+1])/2)) \\ Winston de Greef, Mar 23 2023

Formula

For p a prime, a(p^k) = p.
Showing 1-4 of 4 results.