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.

User: Martin Griffiths

Martin Griffiths's wiki page.

Martin Griffiths has authored 18 sequences. Here are the ten most recent ones:

A168585 Number of ways of partitioning the multiset {1,1,2,3,...,n-1} into exactly five nonempty parts.

Original entry on oeis.org

1, 11, 90, 640, 4151, 25221, 146140, 817730, 4458201, 23835031, 125551790, 653873220, 3375658651, 17308994441, 88284419040, 448429907110, 2270331053501, 11464832543451, 57778226219890, 290711449879400
Offset: 5

Author

Martin Griffiths, Nov 30 2009

Keywords

Crossrefs

The number of ways of partitioning the multiset {1, 1, 2, 3, ..., n-1} into exactly two, three and four nonempty parts are given in A083329, A168583 and A168584, respectively.

Programs

  • Mathematica
    f3[n_] := 1/24 (3 5^(n - 2) - 10 4^(n - 2) + 14 3^(n - 2) - 3 2^(n) + 7); Table[f3[n], {n, 3, 25}]

Formula

For a>=5, a(n) = (3*5^(n-2) - 10*4^(n-2) + 14*3^(n-2) - 3*2^(n) + 7)/24.
The shifted exponential generating function is (375e^(5x) - 640e^(4x) + 378e^(3x) - 96e^(2x) + 7e^x)/24.
The ordinary generating function is x^5(1-4x+10x^2)/((1-x)(1-2x)(1-3x)(1-4x)(1-5x)).

A158895 A list of primes written in order of their first appearance in a table of prime factorizations of 2^k+1, k=1,2,... .

Original entry on oeis.org

3, 5, 17, 11, 13, 43, 257, 19, 41, 683, 241, 2731, 29, 113, 331, 65537, 43691, 37, 109, 174763, 61681, 5419, 397, 2113, 2796203, 97, 673, 251, 4051, 53, 157, 1613, 87211, 15790321, 59, 3033169, 61, 1321, 715827883
Offset: 1

Author

Martin Griffiths, Mar 29 2009

Keywords

Comments

This sequence has the property that if a(n) appears first in the table as a prime factor of 2^m+1 for some m then a(n)=2*k*m+1 for some k.
When, for some m, 2^m+1 has more than one prime factor appearing in the table for the first time, we adopt the convention of entering them in ascending order. For example, the entries ..., 29, 113, ... both arise from 2^14+1.

Examples

			2^1+1=3, 2^2+1=5, 2^3+1=3^2 and 2^4+1=17. Thus a(1)=3, a(2)=5 and a(3)=17, on noting that 2^3+1 contributes no new prime factors.
		

Crossrefs

Subsequence of A001269.

Programs

  • Mathematica
    DeleteDuplicates[Flatten[Table[Transpose[FactorInteger[2^k+1]][[1]],{k,50}]]] (* Harvey P. Dale, Mar 30 2014 *)
  • PARI
    lista(n)=prs = Set(); for (k=1, n, f = factor(2^k+1); for (i=1, length(f~), onef = f[i,1]; if (! setsearch(prs, onef), print1(onef, ", "); prs = setunion(prs, Set(onef));););); \\ Michel Marcus, Apr 18 2013
    
  • PARI
    G=1; for(n=1,500, g=gcd(f=2^n+1,G); while(g>1, g=gcd(g,f/=g)); f=factor(f)[,1]; if(#f, for(i=1,#f, print1(f[i]", ")); G*=factorback(f))) \\ Charles R Greathouse IV, Jan 03 2018

A159062 Nearest integer to the variance of the number of tosses of a fair coin required to obtain at least n heads and n tails.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 61, 62
Offset: 1

Author

Martin Griffiths, Apr 04 2009

Keywords

Comments

For any n, either a(n+1)-a(n)=0 or a(n+1)-a(n)=1.
a(n)/b(n) tends to 1 - 2/Pi as n tends to infinity, where b(n) is the n-th term of A159061.

References

  • M. Griffiths, The Backbone of Pascal's Triangle, United Kingdom Mathematics Trust, 2008, pp. 68-72.

Crossrefs

The nearest integer to the expected number of tosses of a fair coin required to obtain at least n heads and n tails is given in A159061.

Programs

  • Mathematica
    f[n_] := Round[2^(1 - 4 n) n (16^n + Binomial[2 n, n] (4^n - 2 n Binomial[2 n, n]))]; Array[f, 72]
  • PARI
    a(n) = round(2*n*(1+binomial(2*n,n)/(2^(2*n)))-((n*binomial(2*n,n))/(2^(2*n-1)))^2) \\ Felix Fröhlich, Jan 23 2019

Formula

a(n) is the nearest integer to 2*n*(1+binomial(2*n,n)/(2^(2*n)))-((n*binomial(2*n,n))/(2^(2*n-1)))^2.

Extensions

More terms from Robert G. Wilson v, Apr 05 2009
Formula clarified by the author, Apr 06 2009

A168605 Number of ways of partitioning the multiset {1,1,1,2,3,...,n-2} into exactly three nonempty parts.

Original entry on oeis.org

1, 2, 8, 30, 104, 342, 1088, 3390, 10424, 31782, 96368, 291150, 877544, 2640822, 7938848, 23849310, 71613464, 214971462, 645176528, 1936053870, 5809210184, 17429727702, 52293377408, 156888520830, 470682339704, 1412080573542
Offset: 3

Author

Martin Griffiths, Dec 01 2009

Keywords

Comments

The number of ways of partitioning the multiset {1, 1, 1, 2, 3, ..., n-1} into exactly two and four nonempty parts are given in A168604 and A168606, respectively.

Crossrefs

Programs

  • Magma
    [1] cat [(5*3^(n-3) -3*2^(n-2) +3)/3: n in [4..30]]; // G. C. Greubel, Feb 07 2021
  • Mathematica
    a[n_]:= If[n==3, 1, (5*3^(n-3) - 3*2^(n-2) + 3)/3]; Table[a[n], {n, 3, 30}]
  • Sage
    [1]+[(5*3^(n-3) -3*2^(n-2) +3)/3 for n in (4..30)] # G. C. Greubel, Feb 07 2021
    

Formula

a(n) = (5*3^(n-3) - 3*2^(n-2) + 3)/3 for n >= 4, with a(3) = 1.
The shifted e.g.f. is (5*exp(3*x) - 6*exp(2*x) + 3*exp(x) + 1)/3.
G.f.: x^3*(1 -4*x +7*x^2 -2*x^3)/((1-x)*(1-2*x)*(1-3*x)).

Extensions

Last element of the multiset in the definition corrected by Martin Griffiths, Dec 02 2009

A168606 The number of ways of partitioning the multiset {1,1,1,2,3,...,n-2} into exactly four nonempty parts.

Original entry on oeis.org

1, 4, 20, 102, 496, 2294, 10200, 44062, 186416, 776934, 3203080, 13101422, 53279136, 215749174, 870919160, 3507493182, 14101520656, 56620923014, 227128606440, 910449955342, 3647607982976, 14607859562454, 58483727432920
Offset: 4

Author

Martin Griffiths, Dec 01 2009

Keywords

Comments

The number of ways of partitioning the multiset {1, 1, 1, 2, 3, ..., n-1} into exactly two and three nonempty parts are given in A168604 and A168605 respectively.

Crossrefs

Programs

  • Magma
    [(10*4^(n-4) -5*3^(n-3) +9*2^(n-4) -1)/3: n in [4..30]]; // G. C. Greubel, Feb 07 2021
  • Mathematica
    a[n_]:= (10*4^(n-4) - 5*3^(n-3) + 9*2^(n-4) - 1)/3; Table[a[n], {n, 4, 30}]
  • Sage
    [(10*4^(n-4) -5*3^(n-3) +9*2^(n-4) -1)/3 for n in (4..30)] # G. C. Greubel, Feb 07 2021
    

Formula

a(n) = (10*4^(n-4) - 5*3^(n-3) + 9*2^(n-4) - 1)/3.
The shifted e.g.f. is (10*exp(4*x) - 15*exp(3*x) + 9*exp(2*x) - exp(x))/3.
G.f.: x^4*(1 -6*x +15*x^2 -8*x^3)/((1-x)*(1-2*x)*(1-3*x)*(1-4*x)).

Extensions

Last element of the multiset in the definition corrected by Martin Griffiths, Dec 02 2009

A169588 The total number of ways of partitioning the multiset {1,1,1,1,2,3,...,n-3}.

Original entry on oeis.org

5, 12, 38, 141, 592, 2752, 13960, 76464, 448603, 2801054, 18516832, 129034659, 944356507, 7235605732, 57879020756, 482189616711, 4174720731316, 37489711726834, 348592657600818, 3350919079643612, 33252861484374737, 340209759518479300, 3584240435109146792
Offset: 4

Author

Martin Griffiths, Dec 02 2009

Keywords

Crossrefs

This is related to A000110, A035098 and A169587.
Row n=4 of A346426.
Cf. A346814.

Programs

  • Mathematica
    Table[(BellB[n] + 6 BellB[n - 1] + 17 BellB[n - 2] + 20 BellB[n - 3] + 21 BellB[n - 4])/24, {n, 4, 23}]

Formula

For n>=4, a(n)=(Bell(n)+6Bell(n-1)+17Bell(n-2)+20Bell(n-3)+21Bell(n-4))/24, where Bell(n) is the n-th Bell number (the Bell numbers are given in A000110). e.g.f. (e^(4x)+12e^(3x)+42e^(2x)+44e^x+21)(e^(e^x-1))/24.

A169587 The total number of ways of partitioning the multiset {1,1,1,2,3,...,n-2}.

Original entry on oeis.org

3, 7, 21, 74, 296, 1315, 6393, 33645, 190085, 1145246, 7318338, 49376293, 350384315, 2606467211, 20266981269, 164306340566, 1385709542808, 12133083103491, 110095025916745, 1033601910417425, 10024991744613469, 100316367530768074, 1034373400144455266
Offset: 3

Author

Martin Griffiths, Dec 02 2009

Keywords

Examples

			The partitions of {1,1,1,2} are {{1},{1},{1},{2}}, {{1,1},{1},{2}}, {{1,2},{1},{1}}, {{1,1},{1,2}}, {{1,1,1},{2}}, {{1,1,2},{1}} and {{1,1,1,2}}, so a(4)=7.
		

Crossrefs

This is related to A000110, A035098 and A169588.
Row n=3 of A346426.
Cf. A346813.

Programs

  • Mathematica
    Table[(BellB[n] + 3 BellB[n - 1] + 5 BellB[n - 2] + 2 BellB[n - 3])/ 6, {n, 3, 23}]

Formula

For n>=3, a(n)=(Bell(n)+3Bell(n-1)+5Bell(n-2)+2Bell(n-3))/6, where Bell(n) is the n-th Bell number (the Bell numbers are given in A000110).
E.g.f.: (e^(3x)+6e^(2x)+9e^x+2)(e^(e^x-1))/6.

A172106 The triangle T_2(n, m), where T_2(n, m) is the number of surjective multi-valued functions from {1, 1, 2, 3, ..., n-1} to {1, 2, 3, ..., m} by rows (n >= 1, 1 <= m <= n).

Original entry on oeis.org

0, 1, 1, 1, 4, 3, 1, 10, 21, 12, 1, 22, 93, 132, 60, 1, 46, 345, 900, 960, 360, 1, 94, 1173, 4980, 9300, 7920, 2520, 1, 190, 3801, 24612, 71400, 103320, 73080, 20160, 1, 382, 11973, 113652, 480060, 1048320, 1234800, 745920, 181440, 1, 766, 37065, 502500, 2968560, 9170280, 15981840, 15845760, 8346240, 1814400
Offset: 1

Author

Martin Griffiths, Jan 25 2010

Keywords

Comments

T_2(1, m) = 0 by definition. T_2(n, m) also gives the number of compositions (ordered partitions) of {1, 1, 2, 3, ..., n-1} into exactly m parts.

Examples

			Triangle begins as:
  0;
  1,   1;
  1,   4,     3;
  1,  10,    21,     12;
  1,  22,    93,    132,      60;
  1,  46,   345,    900,     960,     360;
  1,  94,  1173,   4980,    9300,    7920,     2520;
  1, 190,  3801,  24612,   71400,  103320,    73080,    20160;
  1, 382, 11973, 113652,  480060, 1048320,  1234800,   745920,  181440;
  1, 766, 37065, 502500, 2968560, 9170280, 15981840, 15845760, 8346240, 1814400;
  ...
T_2(3, 2) = 4 since there are 4 ordered partitions of {1, 1, 2} into exactly 2 parts: (1) {{1}, {1, 2}} (2) {{1, 2}, {1}} (3) {{2}, {1, 1}} (4) {{1, 1},{2}}.
		

Crossrefs

This is related to A019538, A172107 and A172108.
Row sums give A172109.

Programs

  • Magma
    T:= func< n,k,m | n eq 1 select 0 else (&+[(-1)^(k+j)*Binomial(k,j)*Binomial(j+m-1,m)*j^(n-m): j in [1..k]]) >;
    [T(n,k,2): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 13 2022
    
  • Mathematica
    f[r_, n_, m_]:= Sum[Binomial[m, l] Binomial[l+r-1, r] (-1)^(m-l) l^(n-r), {l,m}]; For[n = 2, n <= 10, n++, Print[Table[f[2, n, m], {m, 1, n}]]]
  • SageMath
    def T(n,k,m): return sum( (-1)^(k-j)*binomial(k,j)*binomial(j+m-1,m)*j^(n-m) for j in (1..k) ) - bool(n==1)
    flatten([[T(n,k,2) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Apr 13 2022

Formula

T_2(n, m) = Sum_{j=0..m} binomial(m,j)*binomial(j+1,2)*(-1)^(m-j)*j^(n-2), for n >= 2, with T(1, 1) = 0.
Sum_{k=1..n} T_2(n, k) = A172109(n).
Sum_{k=1..n} (-1)^k*T_2(n, k) = 0. - G. C. Greubel, Apr 13 2022

A172110 a(n) is the number of ordered partitions of {1, 1, 1, 2, 3, ..., n-2}.

Original entry on oeis.org

0, 0, 4, 20, 132, 1076, 10404, 116180, 1469892, 20766836, 323924964, 5527326740, 102396386052, 2046350191796, 43876822764324, 1004631156809300, 24463049576172612, 631213045618035956, 17203155473859536484
Offset: 1

Author

Martin Griffiths, Jan 25 2010

Keywords

Crossrefs

Row sums of A172107.

Programs

  • Magma
    [0,0] cat [(&+[ (&+[Binomial(k,j)*Binomial(j+2,3)*(-1)^(k-j)*j^(n-3): j in [0..k]]): k in [1..n]]): n in [3..25]]; // G. C. Greubel, Apr 15 2022
    
  • Mathematica
    f[r_, n_]:= f[r, n]= If[n<3, 0, Sum[Sum[Binomial[m, l]Binomial[l+r-1, r] (-1)^(m-l) l^(n-r), {l, m}], {m, n}]]; Table[f[3, n], {n, 25}]
  • Sage
    [0,0]+[sum(sum(binomial(k,j)*binomial(j+2,3)*(-1)^(k+j)*j^(n-3) for j in (0..k)) for k in (1..n)) for n in (3..25)] # G. C. Greubel, Apr 15 2022

Formula

T_3(n) = Sum_{m=1..n} Sum_{j=0..m} binomial(m,j)*binomial(j+2,3)*(-1)^(m-j)*j^(n-3) for n > 2 with T_3(1) = T_3(2) = 0.
a(n) ~ n! / (12 * log(2)^(n+1)). - Vaclav Kotesovec, Apr 15 2022

A172109 a(n) is the number of ordered partitions of {1,1,2,3,...,n-1}.

Original entry on oeis.org

0, 2, 8, 44, 308, 2612, 25988, 296564, 3816548, 54667412, 862440068, 14857100084, 277474957988, 5584100659412, 120462266974148, 2772968936479604, 67843210855558628, 1757952715142990612, 48093560991292628228
Offset: 1

Author

Martin Griffiths, Jan 25 2010

Keywords

Crossrefs

Row sums of A172106.
Cf. A005649. - R. J. Mathar, Jan 28 2010
Cf. A083410.

Programs

  • Magma
    [(&+[Factorial(j+1)*StirlingSecond(n-1,j): j in [1..n]]): n in [1..30]]; // G. C. Greubel, Apr 14 2022
    
  • Mathematica
    f[r_, n_]:= Sum[Sum[Binomial[m, l] Binomial[l+r-1, r] (-1)^(m-l) l^(n-r), {l, m}], {m, n}]; Join[{0}, Table[f[2, n], {n,2,30}]]
  • PARI
    a(n) = sum(k=1, n-1, stirling(n-1,k,2)*(k+1)!); \\ Michel Marcus, Apr 14 2022
  • SageMath
    [sum( factorial(j+1)*stirling_number2(n-1,j) for j in (1..n-1) ) for n in (1..30)] # G. C. Greubel, Apr 14 2022
    

Formula

For n>=2, T_2(n) = Sum_{m=1..n} Sum_{l=0..m} C(m,l)*C(l+1,2)*(-1)^(m-l)*l^(n-2).
G.f.: 1/G(0) -1 where G(k) = 1 - x*(k+2)/( 1 - 2*x*(k+1)/G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Mar 23 2013
G.f.: 1/Q(0) -1, where Q(k) = 1 - x*(3*k+2) - 2*x^2*(k+1)*(k+2)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 03 2013
a(n) = Sum_{k=1..n-1} Stirling2(n-1,k)*(k+1)!. - Karol A. Penson, Sep 04 2015
a(n) ~ n! / (4 * log(2)^(n+1)). - Vaclav Kotesovec, Apr 15 2022