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

A027446 Triangle read by rows: square of the lower triangular mean matrix.

Original entry on oeis.org

1, 3, 1, 11, 5, 2, 25, 13, 7, 3, 137, 77, 47, 27, 12, 147, 87, 57, 37, 22, 10, 1089, 669, 459, 319, 214, 130, 60, 2283, 1443, 1023, 743, 533, 365, 225, 105, 7129, 4609, 3349, 2509, 1879, 1375, 955, 595, 280, 7381, 4861, 3601, 2761, 2131, 1627, 1207, 847, 532, 252
Offset: 1

Views

Author

Keywords

Comments

Numerators of nonzero elements of A^2, written as rows using the least common denominator, where A[i,j] = 1/i if j <= i, 0 if j > i. [Edited by M. F. Hasler, Nov 05 2019]

Examples

			Triangle starts
     1
     3,    1
    11,    5,    2
    25,   13,    7,    3
   137,   77,   47,   27,   12
   147,   87,   57,   37,   22,   10
  1089,  669,  459,  319,  214,  130,  60
  2283, 1443, 1023,  743,  533,  365, 225, 105
  7129, 4609, 3349, 2509, 1879, 1375, 955, 595, 280
  ... - _Joerg Arndt_, Mar 29 2013
		

Crossrefs

The row sums give A081528(n), n>=1.
The column sequences give A025529, A027457, A027458 for j=1..3.
The diagonal sequences give A002944, A027449, A027450.

Programs

  • Mathematica
    rows = 10;
    M = MatrixPower[Table[If[j <= i, 1/i, 0], {i, 1, rows}, {j, 1, rows}], 2];
    T = Table[M[[n]]*LCM @@ Denominator[M[[n]]], {n, 1, rows}];
    Table[T[[n, k]], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 05 2013, updated May 06 2022 *)
  • PARI
    A027446_upto(n)={my(M=matrix(n, n, i, j, (j<=i)/i)^2); vector(n,r,M[r,1..r]*denominator(M[r,1..r]))} \\ M. F. Hasler, Nov 05 2019

Formula

The rational matrix A^2, where the matrix A has elements a[i,j] = 1/A002024(i,j), is equal to A119947(i,j)/A119948(i,j).
a(i,j) = lcm(seq(A119948(i,m),m=1..i))*A119947(i,j)/A119948(i,j), 1 <= j =< i and zero otherwise.

Extensions

Edited by M. F. Hasler, Nov 05 2019

A097344 Numerators in binomial transform of 1/(n+1)^2.

Original entry on oeis.org

1, 5, 29, 103, 887, 1517, 18239, 63253, 332839, 118127, 2331085, 4222975, 100309579, 184649263, 1710440723, 6372905521, 202804884977, 381240382217, 13667257415003, 25872280345103, 49119954154463, 93501887462903, 4103348710010689, 7846225754967739, 75162749477272151
Offset: 0

Views

Author

Paul Barry, Aug 06 2004

Keywords

Comments

Is this identical to A097345? - Aaron Gulliver, Jul 19 2007. The answer turns out to be No - see A134652.
If the putative formula a(n)=A081528(n) sum{k=0..n, binomial(n, k)/(k+1)^2} were true, then this sequence coincides with A097345 according to Mathar's notes. However, the term n=9 in the binomial transform of 1/(n+1)^2 has the denominator 5040=A081528(9)/4=A081528(10)/5. So the formula cannot be true. - M. F. Hasler, Jan 25 2008
a(n) is also the numerator of u(n+1) with u(n) = (1/n)*Sum_{k=1..n} (2^k-1)/k and we have the formula: polylog(2,x/(1-x)) = Sum_{n>=1} u(n)*x^n on the interval [-1/2, 1/2]. - Groux Roland, Feb 01 2009

Examples

			The first values of the binomial transform of 1/(n+1)^2 are 1, 5/4, 29/18, 103/48, 887/300, 1517/360, 18239/2940, 63253/6720, 332839/22680, 118127/5040, 2331085/60984, ...
		

Crossrefs

Programs

  • Maple
    f:=n->numer(add( binomial(n,k)/(k+1)^2, k=0..n));
  • Mathematica
    Table[HypergeometricPFQ[{1, 1, -n}, {2, 2}, -1] // Numerator, {n, 0, 24}] (* Jean-François Alcover, Oct 14 2013 *)
  • Maxima
    a(n):=if n<0 then 1 else 1/((n+1)^2)*((n)*(3*n+1)*a(n-1)-2*(n-1)*(n)*a(n-2)+1);
    makelist(num(a(n),n,0,10); /* Vladimir Kruchinin, Jun 01 2016 */
    
  • PARI
    A097344(n)=numerator(sum(k=0,n,binomial(n,k)/(k+1)^2)) \\ M. F. Hasler, Jan 25 2008
    
  • Python
    from fractions import Fraction
    A097344_list, tlist = [1], [Fraction(1,1)]
    for i in range(1,100):
        for j in range(len(tlist)):
            tlist[j] *= Fraction(i,i-j)
        tlist += [Fraction(1,(i+1)**2)]
        A097344_list.append(sum(tlist).numerator) # Chai Wah Wu, Jun 04 2015
    
  • Sage
    def A097344_list(size):
        R, L = [1], [1]
        inc = sqr = 1
        for i in range(1, size):
            for j in range(i):
                L[j] *= i / (i - j)
            inc += 2; sqr += inc
            L.extend(1 / sqr)
            R.append(sum(L).numerator())
        return R
    A097344_list(50) # (after Chai Wah Wu) Peter Luschny, Jun 05 2016

Formula

a(n) = numerator(b(n)), b(n) = 1/((n+1)^2)*((n)*(3*n+1)*b(n-1)-2*(n-1)*(n)*b(n-2)+1). - Vladimir Kruchinin, May 31 2016

Extensions

Edited and corrected by Daniel Glasscock (glasscock(AT)rice.edu), Jan 04 2008 and M. F. Hasler, Jan 25 2008
Moved comment on numerators of a logarithmic g.f. over to A097345 - R. J. Mathar, Mar 04 2010

A119948 Triangle of denominators in the square of the matrix with A[i,j] = 1/i for j <= i, 0 otherwise.

Original entry on oeis.org

1, 4, 4, 18, 18, 9, 48, 48, 48, 16, 300, 300, 300, 100, 25, 120, 120, 120, 360, 180, 36, 980, 980, 980, 2940, 1470, 294, 49, 2240, 2240, 2240, 6720, 6720, 1344, 448, 64, 22680, 22680, 22680, 22680, 22680, 4536
Offset: 1

Views

Author

Wolfdieter Lang, Jul 20 2006

Keywords

Comments

The triangle of the corresponding numerators is A119947. The rationals appear in lowest terms.
The least common multiple (LCM) of row i gives [1, 4, 18, 48, 300, 360, 2940, 6720, 22680, ...], which coincides with A081528.

Examples

			The first rows of the table are:
  [1];
  [4, 4];
  [18, 18, 9];
  [48, 48, 48, 16];
  [300, 300, 300, 100, 25];
  [120, 120, 120, 360, 180, 36]; ...
		

Crossrefs

Row sums give A119950. Row sums of the triangle of rationals always give 1.

Programs

  • PARI
    A119948_upto(n)={my(M=matrix(n, n, i, j, (j<=i)/i)^2); vector(n, r, apply(denominator, M[r, 1..r]))} \\ M. F. Hasler, Nov 05 2019

Formula

T(i,j) = denominator((A^2)[i,j]), where the lower triangular matrix A has elements a[i,j] = 1/i if j <= i, 0 if j > i.

Extensions

Edited by M. F. Hasler, Nov 05 2019

A081530 a(n) = running sum of the first n harmonic numbers, multiplied by the LCM of 1..n.

Original entry on oeis.org

1, 5, 26, 77, 522, 669, 5772, 13827, 48610, 55991, 699612, 785633, 11359222, 12530955, 13726712, 29889983, 550271934, 593094837, 12094689300, 12932216325, 13780828710, 14640022575, 356714770680, 376932115005, 1986818142426
Offset: 1

Views

Author

Amarnath Murthy, Mar 27 2003

Keywords

Comments

Consider triangle in A081525. Write terms in k-th row with denominator = LCM of terms in that row. Sequence gives sum of numerators of terms in n-th row.

Examples

			(1), 2*(1 + 3/2), 6*(1 + 3/2 + 11/6), 12*(1 + 3/2 + 11/6 + 25/12).
		

Crossrefs

Programs

  • Maple
    H:=n->add(1/i,i=1..n):seq((n+1)*ilcm(seq(j,j=1..n))*(H(n+1)-1),n=1..30); # C. Ronaldo
  • Mathematica
    Table[Sum[HarmonicNumber[k], {k, n}] LCM @@ Range[n], {n, 36}] (* Wouter Meeussen *)

Formula

a(n) = lcm(1..n)*(n+1)*(H(n+1)-1), where H(n) is the n-th harmonic number. - C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 19 2004
Equal to A001705(n) / A025527(n). - Martin Fuller, Jan 03 2006

Extensions

More terms from Wouter Meeussen, Apr 13 2003

A386950 A sequence constructed by greedily sampling the pdf (H(10)-H(i))/10, where H(n) is the n-th Harmonic number and the support is [0,9], to minimize discrepancy.

Original entry on oeis.org

0, 1, 0, 2, 3, 0, 1, 4, 0, 2, 5, 1, 0, 3, 0, 1, 6, 2, 4, 0, 1, 0, 3, 2, 7, 0, 5, 1, 0, 2, 4, 1, 3, 0, 0, 1, 6, 2, 0, 3, 5, 1, 4, 8, 0, 2, 0, 1, 0, 3, 2, 1, 0, 4, 7, 0, 5, 1, 6, 2, 3, 0, 1, 0, 2, 4, 0, 1, 3, 0, 2, 5, 1, 0, 0, 3, 4, 1, 6, 2, 0, 1, 0, 7, 2, 3, 0
Offset: 1

Views

Author

Jwalin Bhatt, Aug 10 2025

Keywords

Comments

The pdf of the sequence is the probability to see i as the remainder when you divide 1,2,3... with a random number from [1,10].
The respective probabilities are:
p(0) = 7381/25200 = 0.292896...
p(1) = 4861/25200 = 0.192896...
p(2) = 3601/25200 = 0.142896...
p(3) = 2761/25200 = 0.109563...
p(4) = 2131/25200 = 0.084563...
p(5) = 1627/25200 = 0.064563...
p(6) = 1207/25200 = 0.047896...
p(7) = 121/3600 = 0.033611...
p(8) = 19/900 = 0.021111...
p(9) = 1/100 = 0.01
The sequence repeats after 25200 terms. If the random number is picked from [1,n] the period of the sequence is given by n*lcm{1,2,...,n} (A081528).
The arithmetic mean of this sequence is 2.25.
For a sequence with length n, the n-th root of the product of nonzero terms is (2**(5333/12600))*(3**(559/3150))*(5**(1627/25200))*(7**(121/3600)) which is 1.9302557640832...

Examples

			Let p(k) denote the probability of k and c(k) denote the number of occurrences of k among the first n-1 terms.
We take the ratio of the actual occurrences c(k)+1 to the probability and pick the one with the lowest value.
Since p(k) is monotonic decreasing, we only need to compute c(k) once we see c(k-1).
| n | (c(0)+1)/p(0) | (c(1)+1)/p(1) | (c(2)+1)/p(2) | choice |
|---|---------------|---------------|---------------|--------|
| 1 |     3.414     |       -       |       -       |   0    |
| 2 |     6.828     |     5.181     |       -       |   1    |
| 3 |     6.828     |    10.362     |     6.998     |   0    |
| 4 |    10.242     |    10.362     |     6.998     |   2    |
		

Crossrefs

Cf. A081528.

Programs

  • Mathematica
    samplePDF[numCoeffs_] := Module[{coeffs, counts},
      coeffs = {}; counts = ConstantArray[0, 10];
      Do[
        minTime = Infinity;
        Do[
          time = 10*(counts[[i]] + 1)/(HarmonicNumber[10] - HarmonicNumber[i - 1]);
          If[time < minTime,minIndex = i;minTime = time],{i, 1, 10}];
        counts[[minIndex]] += 1;
        coeffs = Append[coeffs, minIndex - 1],
        {numCoeffs}
       ];
      coeffs
     ]
    A386950 = samplePDF[120]
  • Python
    from sympy import harmonic
    def sample_pdf(num_coeffs):
      coeffs, counts = [], [0]*10
      for _ in range(num_coeffs):
        min_time = float('inf')
        for i, count in enumerate(counts):
          time = 10*(count+1) / (harmonic(10)-harmonic(i))
          if time < min_time:
            min_index, min_time = i, time
        counts[min_index] += 1
        coeffs.append(min_index)
      return coeffs
    A386950 = sample_pdf(120)
Showing 1-5 of 5 results.