A361631 a(n) is the denominator of the median of the distinct prime factors of n.
1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1
Offset: 2
Examples
a(12) = 2 since the distinct prime factors of 12 are 2 and 3, of median equal to 5/2. a(30) = 1 since the distinct prime factors of 30 are 2, 3, and 5, of median equal to 3.
Links
- Winston de Greef, Table of n, a(n) for n = 2..10000
Programs
-
Mathematica
a[n_]:=Denominator[Median[FactorInteger[n][[All, 1]]]]; Array[a,88,2]
-
PARI
a(n)=my(f=factor(n)[,1]~, i=length(f)); denominator(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) = 1.