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.

A032020 Number of compositions (ordered partitions) of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 11, 13, 19, 27, 57, 65, 101, 133, 193, 351, 435, 617, 851, 1177, 1555, 2751, 3297, 4757, 6293, 8761, 11305, 15603, 24315, 30461, 41867, 55741, 74875, 98043, 130809, 168425, 257405, 315973, 431065, 558327, 751491, 958265, 1277867, 1621273
Offset: 0

Views

Author

Christian G. Bower, Apr 01 1998

Keywords

Comments

Compositions into distinct parts are equivalent to (1,1)-avoiding compositions. - Gus Wiseman, Jun 25 2020
All terms are odd. - Alois P. Heinz, Apr 09 2021

Examples

			a(6) = 11 because 6 = 5+1 = 4+2 = 3+2+1 = 3+1+2 = 2+4 = 2+3+1 = 2+1+3 = 1+5 = 1+3+2 = 1+2+3.
From _Gus Wiseman_, Jun 25 2020: (Start)
The a(0) = 1 through a(7) = 13 strict compositions:
  ()  (1)  (2)  (3)    (4)    (5)    (6)      (7)
                (1,2)  (1,3)  (1,4)  (1,5)    (1,6)
                (2,1)  (3,1)  (2,3)  (2,4)    (2,5)
                              (3,2)  (4,2)    (3,4)
                              (4,1)  (5,1)    (4,3)
                                     (1,2,3)  (5,2)
                                     (1,3,2)  (6,1)
                                     (2,1,3)  (1,2,4)
                                     (2,3,1)  (1,4,2)
                                     (3,1,2)  (2,1,4)
                                     (3,2,1)  (2,4,1)
                                              (4,1,2)
                                              (4,2,1)
(End)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem II, Missouri Journal of Mathematical Sciences, Vol. 16, No. 1, Winter 2004, pp. 12-17.

Crossrefs

Row sums of A241719.
Main diagonal of A261960.
Dominated by A003242 (anti-run compositions).
These compositions are ranked by A233564.
(1,1)-avoiding patterns are counted by A000142.
Numbers with strict prime signature are A130091.
(1,1,1)-avoiding compositions are counted by A232432.
(1,1)-matching compositions are counted by A261982.
Inseparable partitions are counted by A325535.
Patterns matched by compositions are counted by A335456.
Strict permutations of prime indices are counted by A335489.

Programs

  • Maple
    b:= proc(n, i) b(n, i):= `if`(n=0, [1], `if`(i<1, [], zip((x, y)
          -> x+y, b(n, i-1), `if`(i>n, [], [0, b(n-i, i-1)[]]), 0))) end:
    a:= proc(n) local l; l:=b(n, n): add((i-1)! *l[i], i=1..nops(l)) end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Dec 12 2012
    # second Maple program:
    T:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
          `if`(k=0, `if`(n=0, 1, 0), T(n-k, k) +k*T(n-k, k-1)))
        end:
    a:= n-> add(T(n, k), k=0..floor((sqrt(8*n+1)-1)/2)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Sep 04 2015
  • Mathematica
    f[list_]:=Length[list]!; Table[Total[Map[f, Select[IntegerPartitions[n], Sort[#] == Union[#] &]]], {n, 0,30}]
    T[n_, k_] := T[n, k] = If[k<0 || n<0, 0, If[k==0, If[n==0, 1, 0], T[n-k, k] + k*T[n-k, k-1]]]; a[n_] := Sum[T[n, k], {k, 0, Floor[(Sqrt[8*n + 1] - 1) / 2]}]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Sep 22 2015, after Alois P. Heinz *)
  • PARI
    N=66;  q='q+O('q^N);
    gf=sum(n=0,N, n!*q^(n*(n+1)/2) / prod(k=1,n, 1-q^k ) );
    Vec(gf)
    /* Joerg Arndt, Oct 20 2012 */
    
  • PARI
    Q(N) = { \\ A008289
      my(q = vector(N)); q[1] = [1, 0, 0, 0];
      for (n = 2, N,
        my(m = (sqrtint(8*n+1) - 1)\2);
        q[n] = vector((1 + (m>>2)) << 2); q[n][1] = 1;
        for (k = 2, m, q[n][k] = q[n-k][k] + q[n-k][k-1]));
      return(q);
    };
    seq(N) = concat(1, apply(q -> sum(k = 1, #q, q[k] * k!), Q(N)));
    seq(43) \\ Gheorghe Coserea, Sep 09 2018

Formula

"AGK" (ordered, elements, unlabeled) transform of 1, 1, 1, 1, ...
G.f.: Sum_{k>=0} k! * x^((k^2+k)/2) / Product_{j=1..k} (1-x^j). - David W. Wilson May 04 2000
a(n) = Sum_{m=1..n} A008289(n,m)*m!. - Geoffrey Critzer, Sep 07 2012

A335448 Numbers whose prime indices are inseparable.

Original entry on oeis.org

4, 8, 9, 16, 24, 25, 27, 32, 40, 48, 49, 54, 56, 64, 80, 81, 88, 96, 104, 112, 121, 125, 128, 135, 136, 144, 152, 160, 162, 169, 176, 184, 189, 192, 208, 224, 232, 240, 243, 248, 250, 256, 272, 288, 289, 296, 297, 304, 320, 324, 328, 336, 343, 344, 351, 352
Offset: 1

Views

Author

Gus Wiseman, Jun 21 2020

Keywords

Comments

First differs from A212164 in lacking 72.
First differs from A293243 in lacking 72.
No terms are squarefree.
Also Heinz numbers of inseparable partitions (A325535). The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
These are also numbers that can be written as a product of prime numbers, each different from the last but not necessarily different from those prior to the last.
A multiset is inseparable iff its maximal multiplicity is greater than one plus the sum of its remaining multiplicities.

Examples

			The sequence of terms together with their prime indices begins:
   4: {1,1}
   8: {1,1,1}
   9: {2,2}
  16: {1,1,1,1}
  24: {1,1,1,2}
  25: {3,3}
  27: {2,2,2}
  32: {1,1,1,1,1}
  40: {1,1,1,3}
  48: {1,1,1,1,2}
  49: {4,4}
  54: {1,2,2,2}
  56: {1,1,1,4}
  64: {1,1,1,1,1,1}
  80: {1,1,1,1,3}
  81: {2,2,2,2}
  88: {1,1,1,5}
  96: {1,1,1,1,1,2}
		

Crossrefs

Complement of A335433.
Separations are counted by A003242 and A335452 and ranked by A333489.
Permutations of prime indices are counted by A008480.
Inseparable partitions are counted by A325535.
Strict permutations of prime indices are counted by A335489.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],Select[Permutations[primeMS[#]],!MatchQ[#,{_,x_,x_,_}]&]=={}&]

A325535 Number of inseparable partitions of n; see Comments.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 5, 5, 8, 11, 16, 19, 28, 35, 48, 60, 79, 99, 131, 161, 205, 256, 324, 397, 498, 609, 755, 921, 1131, 1372, 1677, 2022, 2452, 2952, 3561, 4260, 5116, 6102, 7291, 8667, 10309, 12210, 14477, 17087, 20177, 23752, 27957, 32804, 38496, 45049, 52704
Offset: 0

Views

Author

Clark Kimberling, May 08 2019

Keywords

Comments

Definition: a partition is separable if there is an ordering of its parts in which no consecutive parts are identical; otherwise the partition is inseparable.
A partition with k parts is inseparable if and only if there is a part whose multiplicity is greater than ceiling(k/2). - Andrew Howroyd, Jan 17 2024

Examples

			For n=5, the partition 1+2+2 is separable as 2+1+2, and 2+1+1+1 is inseparable.
From _Gus Wiseman_, Jun 27 2020: (Start)
The a(2) = 2 through a(9) = 11 inseparable partitions:
  11   111   22     2111    33       2221      44         333
             1111   11111   222      4111      2222       3222
                            3111     31111     5111       6111
                            21111    211111    41111      22221
                            111111   1111111   221111     51111
                                               311111     321111
                                               2111111    411111
                                               11111111   2211111
                                                          3111111
                                                          21111111
                                                          111111111
(End)
		

Crossrefs

The Heinz numbers of these partitions are given by A335448.
Strict partitions are counted by A000009 and are all separable.
Anti-run compositions are counted by A003242.
Anti-run patterns are counted by A005649.
Partitions whose differences are an anti-run are A238424.
Separable partitions are counted by A325534.
Anti-run compositions are ranked by A333489.
Anti-run permutations of prime indices are counted by A335452.

Programs

  • Mathematica
    u=Table[Length[Select[Map[Quotient[(1 + Length[#]), Max[Map[Length, Split[#]]]] &,
    IntegerPartitions[nn]], # > 1 &]], {nn, 50}]
    Table[PartitionsP[n] - u[[n]], {n, 1, Length[u]}]
    (* Peter J. C. Moses, May 07 2019 *)
    Table[Length[Select[IntegerPartitions[n],Select[Permutations[#],!MatchQ[#,{_,x_,x_,_}]&]=={}&]],{n,10}] (* Gus Wiseman, Jun 27 2020 *)
  • PARI
    seq(n) = {Vec(sum(k=1, (n+1)\2, x^(2*k-1)*(1 + x - x^(k-1))/((1-x^(k+1))*prod(j=1, k-1, 1 - x^j, 1 + O(x^(n-2*k+2)))), O(x*x^n)), -(n+1))} \\ Andrew Howroyd, Jan 17 2024

Formula

a(n) = A000041(n) - A325534(n).
a(n) = Sum_{k>=1} x^(2*k-1)*(1 + x - x^(k-1))/((1-x^(k+1))*Product_{j=1..k-1} (1 - x^j)). - Andrew Howroyd, Jan 17 2024

Extensions

a(0)=0 prepended by Andrew Howroyd, Jan 31 2024

A001250 Number of alternating permutations of order n.

Original entry on oeis.org

1, 1, 2, 4, 10, 32, 122, 544, 2770, 15872, 101042, 707584, 5405530, 44736512, 398721962, 3807514624, 38783024290, 419730685952, 4809759350882, 58177770225664, 740742376475050, 9902996106248192, 138697748786275802, 2030847773013704704, 31029068327114173810
Offset: 0

Views

Author

Keywords

Comments

For n>1, a(n) is the number of permutations of order n with the length of longest run equal 2.
Boustrophedon transform of the Euler numbers (A000111). [Berry et al., 2013] - N. J. A. Sloane, Nov 18 2013
Number of inversion sequences of length n where all consecutive subsequences i,j,k satisfy i >= j < k or i < j >= k. a(4) = 10: 0010, 0011, 0020, 0021, 0022, 0101, 0102, 0103, 0112, 0113. - Alois P. Heinz, Oct 16 2019

Examples

			1 + x + 2*x^2 + 4*x^3 + 10*x^4 + 32*x^5 + 122*x^6 + 544*x^7 + 2770*x^8 + ...
From _Gus Wiseman_, Jun 21 2021: (Start)
The a(0) = 1 through a(4) = 10 permutations:
  ()  (1)  (1,2)  (1,3,2)  (1,3,2,4)
           (2,1)  (2,1,3)  (1,4,2,3)
                  (2,3,1)  (2,1,4,3)
                  (3,1,2)  (2,3,1,4)
                           (2,4,1,3)
                           (3,1,4,2)
                           (3,2,4,1)
                           (3,4,1,2)
                           (4,1,3,2)
                           (4,2,3,1)
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000111. A diagonal of A010094.
The version for permutations of prime indices is A345164.
The version for compositions is A025047, ranked by A345167.
The version for patterns is A345194.
A049774 counts permutations avoiding adjacent (1,2,3).
A344614 counts compositions avoiding adjacent (1,2,3) and (3,2,1).
A344615 counts compositions avoiding the weak adjacent pattern (1,2,3).
A344654 counts partitions without a wiggly permutation, ranked by A344653.
A345170 counts partitions with a wiggly permutation, ranked by A345172.
A345192 counts non-wiggly compositions, ranked by A345168.
Row sums of A104345.

Programs

  • Haskell
    a001250 n = if n == 1 then 1 else 2 * a000111 n
    -- Reinhard Zumkeller, Sep 17 2014
    
  • Maple
    # With Eulerian polynomials:
    A := (n, x) -> `if`(n<2, 1/2/(1+I)^(1-n), add(add((-1)^j*binomial(n+1, j)*(m+1-j)^n, j=0..m)*x^m, m=0..n-1)):
    A001250 := n -> 2*(I-1)^(1-n)*exp(I*(n-1)*Pi/2)*A(n,I);
    seq(A001250(i), i=0..22); # Peter Luschny, May 27 2012
    # second Maple program:
    b:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
        end:
    a:= n-> `if`(n<2, 1, 2)*b(n, 0):
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 29 2015
  • Mathematica
    a[n_] := 4*Abs[PolyLog[-n, I]]; a[0] = a[1] = 1; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 09 2016, after M. F. Hasler *)
    Table[Length[Select[Permutations[Range[n]],And@@(!(OrderedQ[#]||OrderedQ[Reverse[#]])&/@Partition[#,3,1])&]],{n,8}] (* Gus Wiseman, Jun 21 2021 *)
    a[0]:=1; a[1]:=1; a[n_]:=a[n]=1/(n (n-1)) Sum[a[n-1-k] a[k] k, {k,1, n-1}]; Join[{a[0], a[1]}, Map[2 #! a[#]&, Range[2,24]]] (* Oliver Seipel, May 27 2024 *)
  • PARI
    {a(n) = local(v=[1], t); if( n<0, 0, for( k=2, n+3, t=0; v = vector( k, i, if( i>1, t += v[k+1 - i]))); v[3])} /* Michael Somos, Feb 03 2004 */
    
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( (tan(x + x * O(x^n)) + 1 / cos(x + x * O(x^n)))^2, n))} /* Michael Somos, Feb 05 2011 */
    
  • PARI
    A001250(n)=sum(m=0,n\2,my(k);(-1)^m*sum(j=0,k=n+1-2*m,binomial(k,j)*(-1)^j*(k-2*j)^(n+1))/k>>k)*2-(n==1)  \\ M. F. Hasler, May 19 2012
    
  • PARI
    A001250(n)=4*abs(polylog(-n,I))-(n==1)  \\ M. F. Hasler, May 20 2012
    
  • PARI
    my(x='x+O('x^66), egf=1+2*(tan(x)+1/cos(x))-2-x); Vec(serlaplace(egf)) /* Joerg Arndt, May 28 2012 */
    
  • Python
    from itertools import accumulate, islice
    def A001250_gen(): # generator of terms
        yield from (1,1)
        blist = (0,2)
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=0)))[-1]
    A001250_list = list(islice(A001250_gen(),40)) # Chai Wah Wu, Jun 09-11 2022
    
  • Python
    from sympy import bernoulli, euler
    def A001250(n): return 1 if n<2 else abs(((1<Chai Wah Wu, Nov 13 2024
  • Sage
    # Algorithm of L. Seidel (1877)
    def A001250_list(n) :
        R = [1]; A = {-1:0, 0:2}; k = 0; e = 1
        for i in (0..n) :
            Am = 0; A[k + e] = 0; e = -e
            for j in (0..i) : Am += A[k]; A[k] = Am; k += e
            if i > 1 : R.append(A[-i//2] if i%2 == 0 else A[i//2])
        return R
    A001250_list(22) # Peter Luschny, Mar 31 2012
    

Formula

a(n) = coefficient of x^(n-1)/(n-1)! in power series expansion of (tan(x) + sec(x))^2 = (tan(x)+1/cos(x))^2.
a(n) = coefficient of x^n/n! in power series expansion of 2*(tan(x) + sec(x)) - 2 - x. - Michael Somos, Feb 05 2011
For n>1, a(n) = 2 * A000111(n). - Michael Somos, Mar 19 2011
a(n) = 4*|Li_{-n}(i)| - [n=1] = Sum_{m=0..n/2} (-1)^m*2^(1-k)*Sum_{j=0..k} binomial(k,j)*(-1)^j*(k-2*j)^(n+1)/k - [n=1], where k = k(m) = n+1-2*m and [n=1] equals 1 if n=1 and zero else; Li denotes the polylogarithm (and i^2 = -1). - M. F. Hasler, May 20 2012
From Sergei N. Gladkovskii, Jun 18 2012: (Start)
Let E(x) = 2/(1-sin(x))-1 (essentially the e.g.f.), then
E(x) = -1 + 2*(-1/x + 1/(1-x)/x - x^3/((1-x)*((1-x)*G(0) + x^2))) where G(k) = (2*k+2)*(2*k+3)-x^2+(2*k+2)*(2*k+3)*x^2/G(k+1); (continued fraction, Euler's 1st kind, 1-step).
E(x) = -1 + 2*(-1/x + 1/(1-x)/x - x^3/((1-x)*((1-x)*G(0) + x^2))) where G(k) = 8*k + 6 - x^2/(1 + (2*k+2)*(2*k+3)/G(k+1)); (continued fraction, Euler's 2nd kind, 2-step).
E(x) = (tan(x) + sec(x))^2 = -1 + 2/(1-x*G(0)) where G(k) = 1 - x^2/(2*(2*k+1)*(4*k+3) - 2*x^2*(2*k+1)*(4*k+3)/(x^2 - 4*(k+1)*(4*k+5)/G(k+1))); (continued fraction, 3rd kind, 3-step).
(End)
G.f.: conjecture: 2*T(0)/(1-x) -1, where T(k) = 1 - x^2*(k+1)*(k+2)/(x^2*(k+1)*(k+2) - 2*(1-x*(k+1))*(1-x*(k+2))/Q(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 19 2013
a(n) ~ 2^(n+3) * n! / Pi^(n+1). - Vaclav Kotesovec, Sep 06 2014
a(n) = Sum_{k=0..n-1} A109449(n-1,k)*A000111(k). - Reinhard Zumkeller, Sep 17 2014

Extensions

Edited by Max Alekseyev, May 04 2012
a(0)=1 prepended by Alois P. Heinz, Nov 29 2015

A335452 Number of separations (Carlitz compositions or anti-runs) of the prime indices of n.

Original entry on oeis.org

1, 1, 1, 0, 1, 2, 1, 0, 0, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 1, 0, 0, 2, 0, 1, 1, 6, 1, 0, 2, 2, 2, 2, 1, 2, 2, 0, 1, 6, 1, 1, 1, 2, 1, 0, 0, 1, 2, 1, 1, 0, 2, 0, 2, 2, 1, 6, 1, 2, 1, 0, 2, 6, 1, 1, 2, 6, 1, 1, 1, 2, 1, 1, 2, 6, 1, 0, 0, 2, 1, 6, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Jun 21 2020

Keywords

Comments

The first term that is not a factorial number is a(180) = 12.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
A separation (or Carlitz composition) of a multiset is a permutation with no adjacent equal parts.
a(n) depends only on the prime signature of n. - Andrew Howroyd, Feb 03 2021

Examples

			The a(n) separations for n = 2, 6, 30, 180:
  (1)  (12)  (123)  (12123)
       (21)  (132)  (12132)
             (213)  (12312)
             (231)  (12321)
             (312)  (13212)
             (321)  (21213)
                    (21231)
                    (21312)
                    (21321)
                    (23121)
                    (31212)
                    (32121)
		

Crossrefs

Separations are counted by A003242 and ranked by A333489.
Patterns are counted by A000670 and ranked by A333217.
Permutations of prime indices are counted by A008480.
Inseparable partitions are counted by A325535 and ranked by A335448.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[Permutations[primeMS[n]],!MatchQ[#,{_,x_,x_,_}]&]],{n,100}]
  • PARI
    F(i, j, r, t) = {sum(k=max(0, i-j), min(min(i,t), (i-j+t)\2), binomial(i, k)*binomial(r-i+1, t+i-j-2*k)*binomial(t-1, k-i+j))}
    count(sig)={my(s=vecsum(sig), r=0, v=[1]); for(p=1, #sig, my(t=sig[p]); v=vector(s-r-t+1, j, sum(i=1, #v, v[i]*F(i-1, j-1, r, t))); r += t); v[1]}
    a(n)={count(factor(n)[,2])} \\ Andrew Howroyd, Feb 03 2021

A336107 Number of permutations of the prime indices of n with at least one non-singleton run, or non-separations.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2, 0, 2, 0, 0, 0, 4, 1, 0, 1, 2, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 2, 2, 0, 0, 5, 1, 2, 0, 2, 0, 4, 0, 4, 0, 0, 0, 6, 0, 0, 2, 1, 0, 0, 0, 2, 0, 0, 0, 9, 0, 0, 2, 2, 0, 0, 0, 5, 1, 0, 0, 6, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Sep 03 2020

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
A separation (or Carlitz composition) of a multiset is a permutation with no adjacent equal parts.

Examples

			The a(n) non-separations for n = 12, 36, 60, 72, 180, 420:
  (11)  (112)  (1122)  (1123)  (11122)  (11223)  (11234)
        (211)  (1221)  (1132)  (11212)  (11232)  (11243)
               (2112)  (2113)  (11221)  (11322)  (11324)
               (2211)  (2311)  (12112)  (12213)  (11342)
                       (3112)  (12211)  (12231)  (11423)
                       (3211)  (21112)  (13122)  (11432)
                               (21121)  (13221)  (21134)
                               (21211)  (21123)  (21143)
                               (22111)  (21132)  (23114)
                                        (22113)  (23411)
                                        (22131)  (24113)
                                        (22311)  (24311)
                                        (23112)  (31124)
                                        (23211)  (31142)
                                        (31122)  (32114)
                                        (31221)  (32411)
                                        (32112)  (34112)
                                        (32211)  (34211)
                                                 (41123)
                                                 (41132)
                                                 (42113)
                                                 (42311)
                                                 (43112)
                                                 (43211)
		

Crossrefs

A005117 lists positions of zeros, with complement A013929.
A008480 counts permutations of prime indices, ranked by A333221.
A003242 and A335452 count separations, ranked by A333489.
A325535 counts inseparable partitions, ranked by A335448.
A325534 counts separable partitions, ranked by A335433.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[Permutations[primeMS[n]],MatchQ[#,{_,x_,x_,_}]&]],{n,100}]

Formula

a(n) = A008480(n) - A335452(n).
a(A000961(n)) = 0 if n is in A027883, otherwise 1.
a(A005117(n)) = 0.
a(n!) = A335459(n).
a(A006939(n)) = A022915(n).

A261960 Number A(n,k) of compositions of n such that no part equals any of its k immediate predecessors; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 3, 8, 1, 1, 1, 3, 4, 16, 1, 1, 1, 3, 3, 7, 32, 1, 1, 1, 3, 3, 5, 14, 64, 1, 1, 1, 3, 3, 5, 11, 23, 128, 1, 1, 1, 3, 3, 5, 11, 15, 39, 256, 1, 1, 1, 3, 3, 5, 11, 13, 23, 71, 512, 1, 1, 1, 3, 3, 5, 11, 13, 19, 37, 124, 1024
Offset: 0

Views

Author

Alois P. Heinz, Sep 06 2015

Keywords

Examples

			Square array A(n,k) begins:
:  1,  1,  1,  1,  1,  1,  1, ...
:  1,  1,  1,  1,  1,  1,  1, ...
:  2,  1,  1,  1,  1,  1,  1, ...
:  4,  3,  3,  3,  3,  3,  3, ...
:  8,  4,  3,  3,  3,  3,  3, ...
: 16,  7,  5,  5,  5,  5,  5, ...
: 32, 14, 11, 11, 11, 11, 11, ...
		

Crossrefs

Columns k=0-2 give: A011782, A003242, A261962.
Main diagonal gives A032020.

Programs

  • Maple
    b:= proc(n, l) option remember;
          `if`(n=0, 1, add(`if`(j in l, 0, b(n-j,
          `if`(l=[], [], [subsop(1=NULL, l)[], j]))), j=1..n))
        end:
    A:= (n, k)-> b(n, [0$min(n, k)]):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[n_, l_] := b[n, l] = If[n==0, 1, Sum[If[MemberQ[l, j], 0, b[n-j, If[l == {}, {}, Append[Rest[l], j]]]], {j, 1, n}]]; A[n_, k_] := b[n, Array[0&, Min[n, k]]]; Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 08 2017, translated from Maple *)

A261961 Number of ordered set partitions of {1,2,...,n} such that no part has the same size as any of its two immediate predecessors.

Original entry on oeis.org

1, 1, 1, 7, 9, 31, 403, 1597, 7913, 68551, 539691, 4359037, 48419715, 560648557, 4985097601, 59798395027, 869794249513, 11143895125527, 159575614945315, 2593765421983597, 38615447492264219, 642012651525487501, 11768461266053785921, 220201814964135821967
Offset: 0

Views

Author

Alois P. Heinz, Sep 06 2015

Keywords

Crossrefs

Column k=2 of A261959.
Cf. A261962.

Programs

  • Maple
    b:= proc(n, i, j) option remember; `if`(n=0, 1, add(
          `if`(k=i or k=j, 0, (t-> binomial(n, k)*b(t,
          `if`(k>t, 0, k), `if`(i>t, 0, i)))(n-k)), k=1..n))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..30);
  • Mathematica
    b[n_, i_, j_] := b[n, i, j] = If[n == 0, 1, Sum[If[k == i || k == j, 0, Function[t, Binomial[n, k]*b[t, If[k > t, 0, k], If[i > t, 0, i]]][n - k]], {k, 1, n}]];
    a[n_] := b[n, 0, 0];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 24 2018, translated from Maple *)
Showing 1-8 of 8 results.