A226725 Denominator of the median of {1, 1/2, 1/3, ..., 1/n}.
1, 4, 2, 12, 3, 24, 4, 40, 5, 60, 6, 84, 7, 112, 8, 144, 9, 180, 10, 220, 11, 264, 12, 312, 13, 364, 14, 420, 15, 480, 16, 544, 17, 612, 18, 684, 19, 760, 20, 840, 21, 924, 22, 1012, 23, 1104, 24, 1200, 25, 1300, 26, 1404, 27, 1512, 28, 1624, 29, 1740, 30
Offset: 1
Examples
median{1, 1/2, 1/3, 1/4} = (1/2 + 1/3)/2 = 7/12, so that a(4) = 12.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..2000
- Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
Programs
-
Maple
A226725:=n->n^(1/2 + (-1)^n/2)*(n + 2^(1/2 + (-1)^n/2))/2: seq(A226725(n), n=1..100); # Wesley Ivan Hurt, Feb 27 2015
-
Mathematica
Denominator[Table[Median[Table[1/k, {k, n}]], {n, 120}]] f[n_] := If[ OddQ@ n, Floor[(n + 1)/2], n(n/2 + 1)]; Array[f, 59] (* Robert G. Wilson v, Feb 27 2015 *) With[{nn=30},Riffle[Range[nn],Table[2n+2n^2,{n,nn}]]] (* Harvey P. Dale, May 26 2019 *) Riffle[Range[60],LinearRecurrence[{3,-3,1},{4,12,24},60]] (* Harvey P. Dale, Oct 03 2023 *)
-
PARI
Vec(x*(x^2-4*x-1)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Feb 27 2015
Formula
a(n) = (n+1)/2 if n is odd, a(n) = n*(n/2+1) if n is even.
G.f.: W(0), where W(k)= 1 + 2*x*(k+2)/( 1 - x/(x + 2*(k+1)/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). - Colin Barker, Feb 27 2015
G.f.: x*(x^2-4*x-1) / ((x-1)^3*(x+1)^3). - Colin Barker, Feb 27 2015
a(n) = n^(1/2 + (-1)^n/2)*(n + 2^(1/2 + (-1)^n/2))/2. - Wesley Ivan Hurt, Feb 27 2015
a(n) = Sum_{k=0..n} (-1)^k * A061579(n,k). - Alois P. Heinz, Feb 10 2023
Extensions
Formula changed for even terms by Luca Brigada Villa, Jun 20 2013