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-8 of 8 results.

A093414 Row sums of A093412.

Original entry on oeis.org

1, 3, 9, 15, 18, 36, 49, 52, 68, 105, 90, 153, 151, 136, 225, 276, 217, 351, 300, 297, 416, 528, 402, 538, 598, 563, 639, 861, 547, 990, 961, 808, 1061, 945, 913, 1431, 1342, 1158, 1268, 1770, 1158, 1953, 1704, 1351, 2003, 2346, 1698, 2268, 2051, 2047
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Crossrefs

Extensions

Edited and extended by David Wasserman, Feb 01 2006

A093413 Largest number in row n of A093412.

Original entry on oeis.org

1, 2, 5, 7, 7, 11, 13, 13, 17, 19, 19, 23, 25, 23, 29, 31, 31, 35, 37, 37, 41, 43, 43, 47, 49, 49, 53, 55, 53, 59, 61, 61, 65, 67, 67, 71, 73, 73, 77, 79, 79, 83, 85, 83, 89, 91, 91, 95, 97, 97, 101, 103, 103, 107, 109, 109, 113, 115, 113, 119, 121, 121, 125, 127, 127, 131
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Crossrefs

Formula

Let f(x) be the least odd prime that does not divide x; then a(n) = A093412(n, f(n+1)-1).

Extensions

Edited and extended by David Wasserman, Feb 01 2006

A093419 Denominators of row sums in triangle described in A093412.

Original entry on oeis.org

1, 1, 3, 6, 5, 10, 35, 140, 126, 1260, 1155, 13860, 12870, 12012, 45045, 360360, 340340, 2042040, 1939938, 369512, 117572, 2586584, 7436429, 178474296, 171609900, 1487285800, 1434168450, 40156716600, 38818159380, 1164544781400
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Crossrefs

Essentially the same as A096620.

Programs

  • Mathematica
    Do[s = i = n; j = 1; x = i; y = j; While[x/y != 1, i--; j++; x += i; y += j; s += x/y]; Print[Denominator[s]], {n, 1, 30}] (* Ryan Propper, Aug 16 2005 *)

Extensions

Corrected and extended by Ryan Propper, Aug 16 2005

A093418 Numerator of -3*n + 2*(1+n)*HarmonicNumber(n).

Original entry on oeis.org

0, 1, 3, 17, 53, 62, 163, 717, 3489, 3727, 43391, 45596, 619313, 644063, 667229, 2756003, 24124223, 24784883, 160941559, 164719333, 33664415, 11451017, 268428987, 819836496, 20845424563, 21181779967, 193553388003, 196368607553, 5773568883787, 5849866645327
Offset: 0

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Comments

Numerator of the average time to quicksort n items in random order.
From Petros Hadjicostas, Oct 20 2019: (Start)
Depending on the assumptions used in the literature, the average number to sort n items in random order by quicksort appears as -C*n + 2*(1+n)*HarmonicNumber(n), where C = 2, 3, or 4. See, for example, A115107 and A288964. Other variations of the above formula are possible.
Let X_n be the random number of comparisons needed to sort a list of numbers in the symmetric group S_n and let R_n be the rank of the pivot. According to Havil (2003, pp. 128-130), we have X_n = n + X_{R_n-1} + X_{n-R_n} because it takes 1 unit of comparison time to pick the pivot and n-1 comparisons to divide the data into two lists of numbers (less than the pivot and greater than the pivot). No matter how we pick the pivot, we have to assume that R_n is jointly independent of (X_1, ..., X_n). We let X_0 = 0.
Denoting expectation by E(.) and conditional expectation by E(.|.), we have E(X_n) = Sum_{r = 1..n} E(n + X_{R_n-1} + X_{n-R_n} | R_n=r) * P(R_n=r) = n + (1/n) * (E(X_{r-1}) + E(X_{n-r})) The last step follows from the assumed independence of R_n from (X_1, ..., X_n). This simplifies to E(X_n) = n + (2/n) * Sum_{r = 0..n-1} E(X_r). As in Havil (2003), solving the recurrence we get E(X_n) = fr(n) = -3*n + 2*(1+n)*HarmonicNumber(n). Here a(n) = numerator(E(X_n)) and A096620(n) = denominator(E(X_n)).
Note that E(X_n)*n! = (-3*n + 2*(1+n)*HarmonicNumber(n)) * n! = A063090(n), and according to the documentation of that sequence, A063090(n)/(n*n!) is the "average number of comparisons needed to find a node in a binary search tree containing n nodes inserted in a random order". See Knuth (1998, Vol. 3, pp. 430-431 and Exercise 6 on pp. 454-455).
Other authors (e.g., Cameron (1996)) do not count the choice of the pivot as a comparison time. In such a case, if we let Y_n be the modified number of comparisons used by quicksort to sort a random list of length n, we get the modified recurrence Y_n = n - 1 + Y_{R_n-1} + Y_{n-R_n}, from which we get E(Y_n) = n - 1 + (2/n) * Sum_{r = 0..n-1} E(Y_r). Solving this modified recurrence, we get E(Y_n) = -4*n + + 2*(1+n)*HarmonicNumber(n). In such a case, A115107(n) = numerator(E(Y_n)) = numerator(-4*n + 2*(1+n)*HarmonicNumber(n)) and A288964(n) = n! * E(Y_n) = n! * (-4*n + 2*(1+n)*HarmonicNumber(n)).
(End)

Examples

			fr(n) = 0, 1, 3, 17/3, 53/6, 62/5, 163/10, 717/35, 3489/140, ... = A093418/A096620.
		

References

  • Peter J. Cameron, Combinatorics: Topics, Techniques and Algorithms, Cambridge Univ. Press, 1996; see pp. 66-68.
  • J. H. Conway and R. K. Guy, The Book of Numbers. New York: Springer-Verlag, 1996, pp. 143 and 258-259.
  • Julian Havil, Gamma: Exploring Euler's constant, Princeton University Press, 2003; see pp. 128-130.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, 1998; see pp. 427-431 and 454-455.

Crossrefs

The denominators in A096620 are essentially the same as the numbers in A093419, which are the denominators of A093412.

Programs

  • Magma
    [Numerator(2*(n+1)*HarmonicNumber(n) -3*n): n in [0..50]]; // G. C. Greubel, Sep 01 2018
    
  • Maple
    a := n -> numer(2*(n + 1)*(Psi(n + 1) + gamma) - 3*n);
    seq(a(n), n=0..26); # Peter Luschny, Aug 26 2019
  • Mathematica
    Numerator[Table[2*Sum[Sum[1/i, {i, 1, k}], {k, 1, n}]-n, {n, 0, 20}]] (* or *) Numerator[Table[2*Sum[HarmonicNumber[k], {k, 1, n}]-n, {n, 0, 20}]]
    Numerator[Table[2*(n+1)*HarmonicNumber[n] - 3*n, {n, 0, 50}]] (* G. C. Greubel, Sep 01 2018 *)
  • PARI
    {h(n) = sum(k=1,n,1/k)};
    for(n=0,50, print1(numerator(2*(n+1)*h(n) -3*n), ", ")) \\ G. C. Greubel, Sep 01 2018
    
  • Python
    from fractions import Fraction
    from itertools import count, islice
    def agen(): # generator of terms
        Hn = Fraction(0, 1)
        for n in count(0):
            yield (-3*n + 2*(1+n)*Hn).numerator
            Hn += Fraction(1, n+1)
    print(list(islice(agen(), 27))) # Michael S. Branicky, Apr 17 2022

Formula

G.f. for fractions fr(n): -(x+2*log(1-x))/(1-x)^2. - Vladeta Jovovic, Jul 05 2004
a(n) = 1 + (1/n!) * Sum_{k=0..n} (-1)^(n-k) * Stirling1(n, k) * (k-1) * 2^k. - Vladeta Jovovic, Jul 05 2004
a(n) = numerator(-n + 2 * H^{2}(n)), where H^{2}(n) = Sum_{k=1..n} HarmonicNumber(k) is second-order harmonic number. - Alexander Adamchuk, Nov 01 2004

Extensions

Edited by Eric W. Weisstein, Jul 01 2004
Offset changed to 0 by Petros Hadjicostas, Aug 26 2019

A093415 Triangle read by rows: a(n, k) is the denominator of (n + (n-1) + ... + (n-k+1))/(1 + 2 + ... + k), 0 < k <= n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 3, 2, 1, 1, 1, 1, 5, 1, 1, 3, 2, 5, 3, 1, 1, 3, 1, 5, 3, 7, 1, 1, 1, 2, 5, 1, 7, 4, 1, 1, 3, 1, 1, 3, 7, 2, 9, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 1, 1, 1, 1, 5, 1, 7, 1, 3, 5, 11, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 1, 1, 3, 1, 5, 3, 1, 2, 9, 5, 11, 3, 13, 1, 1, 1, 2, 1, 1, 7, 4, 3, 1, 11, 2
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Comments

A093412 gives the corresponding numerators.
A109613(n+1) - 2 = 2*floor((n+1)/2) - 1 is the largest number in row n. [Corrected by Petros Hadjicostas, Oct 20 2019]

Examples

			Triangle a(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  1;
  1, 1;
  1, 3, 1;
  1, 3, 2, 1;
  1, 1, 1, 5, 1;
  1, 3, 2, 5, 3, 1;
  1, 3, 1, 5, 3, 7, 1;
  1, 1, 2, 5, 1, 7, 4, 1;
  1, 3, 1, 1, 3, 7, 2, 9, 1;
... - _Petros Hadjicostas_, Oct 20 2019
		

Crossrefs

Formula

a(n, k) = (k+1)/gcd(2n+2, k+1).

Extensions

Edited and extended by David Wasserman, Feb 01 2006

A093420 Triangle read by rows: T(n,k) is the numerator of f(n, k) = (Product_{i = 0..k-1} (n-i))/(Sum_{i = 1..k} i) for 1 <= k <= n.

Original entry on oeis.org

1, 2, 2, 3, 2, 1, 4, 4, 4, 12, 5, 20, 10, 12, 8, 6, 10, 20, 36, 48, 240, 7, 14, 35, 84, 168, 240, 180, 8, 56, 56, 168, 448, 960, 1440, 1120, 9, 24, 84, 1512, 1008, 2880, 6480, 10080, 8064, 10, 30, 120, 504, 2016, 7200, 21600, 50400, 80640, 725760, 11, 110, 165
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  1,
  2,  2,
  3,  2,  1,
  4,  4,  4, 12,
  5, 20, 10, 12,   8,
  6, 10, 20, 36,  48, 240,
  7, 14, 35, 84, 168, 240, 180;
  ...
		

Crossrefs

Cf. A090585, A090586, A093412, A093421 (denominators), A093422.

Formula

T(n,n) = numerator(f(n, n)) = numerator(2*(n-1)!/(n+1)) = A090586(n).

Extensions

Edited and extended by David Wasserman, Aug 29 2006

A093422 In the triangle shown below the n-th row contains n rational numbers n/1, {n*(n-1)}/{n +(n-1)}, {(n)*(n-1)*(n-2)}/{n +(n-1)+(n-2)}, ..., the last term being 2*(n-1)!/(n+1). Sequence gives the numerators in each row.

Original entry on oeis.org

1, 2, 2, 3, 6, 1, 4, 12, 8, 12, 5, 20, 5, 60, 8, 6, 30, 8, 20, 36, 240, 7, 42, 35, 420, 504, 560, 180, 8, 56, 16, 840, 224, 6720, 1152, 1120, 9, 72, 21, 504, 432, 20160, 4320, 90720, 8064, 10, 90, 80, 2520, 756, 3360, 86400, 453600, 67200, 725760, 11, 110, 33, 3960
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Examples

			Triangle of fractions starts
  1,
  2, 2/3,
  3, 6/5, 1,
  4, 12/7, 8/3, 12/5,
  5, 20/9, 5, 60/7, 8,
  6, 30/11, 8, 20, 36, 240/7,
  7, 42/13, 35/3, 420/11, 504/5, 560/3, 180,
  8, 56/15, 16, 840/13, 224, 6720/11, 1152, 1120,
  9, 72/17, 21, 504/5, 432, 20160/13, 4320, 90720/11, 8064,
		

Crossrefs

Programs

  • Magma
    /* as a triangle */ [[k le 1 select n else Numerator(2*Binomial(n,k)*Factorial(k-1)/(2*n-k+1)): k in [1..n]]: n in [1..10]]; // G. C. Greubel, Sep 01 2018
  • Maple
    A09342x := proc(n,m) local i,N,D ; N := n ; if m = 1 then D := 1 ; else D := n ; end ; for i from 1 to m-1 do N := N*(n-i) ; D := D+n-i ; od ; simplify(N/D) ; end: A093422 := proc(n,m) numer(A09342x(n,m)) ; end: for n from 1 to 12 do for m from 1 to n do printf("%d, ",A093422(n,m)) ; od ; od ; # R. J. Mathar, Apr 28 2007
  • Mathematica
    Table[If[k == 1, n, Numerator[2*Binomial[n,k]*(k-1)!/(2*n-k+1)]], {n,1,30}, {k,1,n}]//Flatten (* G. C. Greubel, Sep 01 2018 *)
  • PARI
    for(n=1,10, for(k=1,n, print1(if(k==1, n, denominator(2*binomial(n,k)*(k-1)!/(2*n-k+1))), ", "))) \\ G. C. Greubel, Sep 01 2018
    

Formula

A093422(n,m)/A093423(n,m) = 2*binomial(n,m)*(m-1)!/(2*n-m+1) for 2 <= m < n. A093422(n,1)/A093423(n,1)= n. - R. J. Mathar, Apr 28 2007

Extensions

More terms from R. J. Mathar, Apr 28 2007

A093423 Consider the triangle whose first part is shown as an example in the entry A093422. If the n-th term of the triangle read by rows is a fraction then a(n) is the denominator of the fraction, otherwise a(n)=1.

Original entry on oeis.org

1, 1, 3, 1, 5, 1, 1, 7, 3, 5, 1, 9, 1, 7, 1, 1, 11, 1, 1, 1, 7, 1, 13, 3, 11, 5, 3, 1, 1, 15, 1, 13, 1, 11, 1, 1, 1, 17, 1, 5, 1, 13, 1, 11, 1, 1, 19, 3, 17, 1, 1, 7, 13, 1, 11, 1, 21, 1, 19, 1, 17, 1, 1, 1, 13, 1, 1, 23, 1, 7, 5, 19, 1, 17, 1, 1, 1, 13
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Examples

			Triangle begins:
  1;
  1,  3;
  1,  5,  1;
  1,  7,  3,  5;
  1,  9,  1,  7,  1;
  1, 11,  1,  1,  1,  7;
  1, 13,  3, 11,  5,  3,  1;
  1, 15,  1, 13,  1, 11,  1,  1;
  ...
		

Crossrefs

Programs

  • Magma
    /* as a triangle */ [[Denominator(2*Binomial(n,k)*Factorial(k-1)/(2*n-k+1)): k in [1..n]]: n in [1..30]]; // G. C. Greubel, Sep 01 2018
  • Maple
    A09342x := proc(n,m) local a,i,N,D ; N := n ; if m = 1 then D := 1 ; else D := n ; end ; for i from 1 to m-1 do N := N*(n-i) ; D := D+n-i ; od ; simplify(N/D) ; end: A093423 := proc(n,m) denom(A09342x(n,m)) ; end: for n from 1 to 12 do for m from 1 to n do printf("%d, ",A093423(n,m)) ; od ; od ; # R. J. Mathar, Apr 28 2007
  • Mathematica
    Table[Denominator[2*Binomial[n,k]*(k-1)!/(2*n-k+1)], {n,1,30}, {k,1,n}]//Flatten (* G. C. Greubel, Sep 01 2018 *)
  • PARI
    for(n=1,10, for(k=1,n, print1(denominator(2*binomial(n,k)*(k-1)!/(2*n-k+1)), ", "))) \\ G. C. Greubel, Sep 01 2018
    

Formula

A093422(n,m)/A093423(n,m) = 2*binomial(n,m)*(m-1)!/(2*n-m+1) for 2 <= m < n. A093422(n,1)/A093423(n,1)= n. - R. J. Mathar, Apr 28 2007

Extensions

More terms from R. J. Mathar, Apr 28 2007
Better definition from Omar E. Pol, Jan 10 2009
Showing 1-8 of 8 results.