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.

Previous Showing 21-28 of 28 results.

A349801 Number of integer partitions of n into three or more parts or into two equal parts.

Original entry on oeis.org

0, 0, 1, 1, 3, 4, 8, 11, 18, 25, 37, 50, 71, 94, 128, 168, 223, 288, 376, 480, 617, 781, 991, 1243, 1563, 1945, 2423, 2996, 3704, 4550, 5589, 6826, 8333, 10126, 12293, 14865, 17959, 21618, 25996, 31165, 37318, 44562, 53153, 63239, 75153, 89111, 105535, 124730
Offset: 0

Views

Author

Gus Wiseman, Dec 23 2021

Keywords

Comments

This sequence arose as the following degenerate case. If we define a sequence to be alternating if it is alternately strictly increasing and strictly decreasing, starting with either, then a(n) is the number of non-alternating integer partitions of n. Under this interpretation:
- The non-strict case is A047967, weak A349796, weak complement A349795.
- The complement is counted by A065033(n) = ceiling(n/2) for n > 0.
- These partitions are ranked by A289553 \ {1}, complement A167171 \/ {1}.
- The version for compositions is A345192, ranked by A345168.
- The weak version for compositions is A349053, ranked by A349057.
- The weak version is A349061, complement A349060, ranked by A349794.

Examples

			The a(2) = 1 through a(7) = 11 partitions:
  (11)  (111)  (22)    (221)    (33)      (322)
               (211)   (311)    (222)     (331)
               (1111)  (2111)   (321)     (421)
                       (11111)  (411)     (511)
                                (2211)    (2221)
                                (3111)    (3211)
                                (21111)   (4111)
                                (111111)  (22111)
                                          (31111)
                                          (211111)
                                          (1111111)
		

Crossrefs

A000041 counts partitions, ordered A011782.
A001250 counts alternating permutations, complement A348615.
A004250 counts partitions into three or more parts, strict A347548.
A025047/A025048/A025049 count alternating compositions, ranked by A345167.
A096441 counts weakly alternating 0-appended partitions.
A345165 counts partitions w/ no alternating permutation, complement A345170.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],MatchQ[#,{x_,x_}|{,,__}]&]],{n,0,10}]

Formula

a(1) = 0; a(n > 0) = A000041(n) - ceiling(n/2).

A006477 Number of partitions of n with at least 1 odd and 1 even part.

Original entry on oeis.org

0, 0, 0, 1, 1, 4, 4, 10, 11, 22, 25, 44, 51, 83, 98, 149, 177, 259, 309, 436, 521, 716, 857, 1151, 1376, 1816, 2170, 2818, 3361, 4309, 5132, 6502, 7728, 9695, 11501, 14298, 16924, 20877, 24661, 30203, 35598, 43323, 50956, 61651, 72357, 87086, 101999
Offset: 0

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[n_?OddQ] := PartitionsP[n] - PartitionsQ[n]; a[n_?EvenQ] := PartitionsP[n] - PartitionsQ[n] - PartitionsP[n/2]; a[0] = 0; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 17 2014, after Vladeta Jovovic *)

Formula

Convolution of 0, 1, 1, 2, 2, 3, 4, 5, 6, ... (essentially A000009) and 0, 0, 1, 0, 2, 0, 3, 0, 5, ... (essentially A035363).
G.f.: (prod(1/(1-x^k), k odd)-1) * (prod(1/(1-x^k), k even)-1).
A000041(n)-A000009(n) if n is odd else A000041(n)-A000009(n)-A000041(n/2). - Vladeta Jovovic, Sep 10 2003
a(n) = A000041(n) - A096441(n), n >= 1. - Omar E. Pol, Aug 16 2013

Extensions

More terms from David W. Wilson, May 11 2001

A239327 Number of palindromic Carlitz compositions of n.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 2, 5, 5, 7, 10, 14, 14, 25, 26, 42, 48, 75, 79, 132, 142, 226, 252, 399, 432, 704, 760, 1223, 1336, 2143, 2328, 3759, 4079, 6564, 7150, 11495, 12496, 20135, 21874, 35215, 38310, 61639, 67018, 107912, 117298, 188839, 205346, 330515, 359350, 578525, 628951
Offset: 0

Views

Author

Geoffrey Critzer, Mar 16 2014

Keywords

Comments

A palindromic composition is a composition that is identical to its own reverse. There are 2^floor(n/2) palindromic compositions. A Carlitz composition has no two consecutive equal parts (A003242). This sequence enumerates compositions that are both palindromic and Carlitz.
Also the number of odd-length integer compositions of n into parts that are alternately unequal and equal (n > 0). The unordered version (partitions) is A053251. - Gus Wiseman, Feb 26 2022

Examples

			a(9) = 7 because we have: 9, 1+7+1, 2+5+2, 4+1+4, 1+3+1+3+1, 2+1+3+1+2, 1+2+3+2+1. 2+3+4 is not counted because it is not palindromic. 3+3+3 is not counted because it has consecutive equal parts.
		

References

  • S. Heubach and T. Mansour, Compositions of n with parts in a set, Congr. Numer. 168 (2004), 127-143.
  • S. Heubach and T. Mansour, Combinatorics of Compositions and Words, Chapman and Hall, 2010, page 67.

Crossrefs

Carlitz compositions are counted by A003242.
Palindromic compositions are counted by A016116.
The unimodal case is A096441.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(i=0, 0, `if`(n=0, 1,
          add(`if`(i=j, 0, b(n-j, j)), j=1..n)))
        end:
    a:= n-> `if`(n=0, 1, add(b(i, n-2*i), i=0..n/2)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 16 2014
  • Mathematica
    nn=50;CoefficientList[Series[(1+Sum[x^j(1-x^j)/(1+x^(2j)),{j,1,nn}])/(1-Sum[x^(2j)/(1+x^(2j)),{j,1,nn}]),{x,0,nn}],x]
    (* or *)
    Table[Length[Select[Level[Map[Permutations,Partitions[n]],{2}],Apply[And,Table[#[[i]]==#[[Length[#]-i+1]],{i,1,Floor[Length[#]/2]}]]&&Apply[And,Table[#[[i]]!=#[[i+1]],{i,1,Length[#]-1}]]&]],{n,0,20}]
  • PARI
    a(n) = polcoeff((1 + sum(j=1, n, x^j*(1-x^j)/(1+x^(2*j)) + O(x*x^n))) / (1 - sum(j=1, n, x^(2*j)/(1+x^(2*j)) + O(x*x^n))), n); \\ Andrew Howroyd, Oct 12 2017

Formula

G.f.: (1 + Sum_{j>=1} x^j*(1-x^j)/(1+x^(2*j))) / (1 - Sum_{j>=1} x^(2*j)/(1+x^(2*j))).
a(n) ~ c / r^n, where r = 0.7558768372943356987836792261127971643747976345582722756032673... is the root of the equation sum_{j>=1} x^(2*j)/(1+x^(2*j)) = 1, c = 0.5262391407444644722747255167331403939384758635340487280277... if n is even and c = 0.64032989654153238794063877354074732669441634551692765196197... if n is odd. - Vaclav Kotesovec, Aug 22 2014

A350137 Nonsquarefree numbers whose prime signature, except possibly the first and last parts, is all even.

Original entry on oeis.org

4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, 52, 54, 56, 63, 64, 68, 72, 75, 76, 80, 81, 88, 90, 92, 96, 98, 99, 100, 104, 108, 112, 116, 117, 121, 124, 125, 126, 128, 135, 136, 144, 147, 148, 152, 153, 160, 162, 164, 169, 171, 172
Offset: 1

Views

Author

Gus Wiseman, Dec 23 2021

Keywords

Comments

A number's prime signature (row n of A124010) is the sequence of positive exponents in its prime factorization.
Also nonsquarefree numbers whose prime factors, taken in order and with multiplicity, are alternately constant and weakly increasing, starting with either.
Also the Heinz numbers of non-strict integer partitions whose part multiplicities, except possibly the first and last, are all even. These are counted by A349795.

Examples

			The terms together with their prime indices begin:
    4: {1,1}
    8: {1,1,1}
    9: {2,2}
   12: {1,1,2}
   16: {1,1,1,1}
   18: {1,2,2}
   20: {1,1,3}
   24: {1,1,1,2}
   25: {3,3}
   27: {2,2,2}
   28: {1,1,4}
   32: {1,1,1,1,1}
   36: {1,1,2,2}
   40: {1,1,1,3}
   44: {1,1,5}
   45: {2,2,3}
   48: {1,1,1,1,2}
		

Crossrefs

This is the nonsquarefree case of the complement of A349794.
These are the Heinz numbers of the partitions counted by A349795.
A version for compositions is A349799, counted by A349800.
A complementary version is A350140, counted by A349796.
A001250 = alternating permutations, ranked by A349051, complement A348615.
A005117 = squarefree numbers, complement A013929.
A025047/A025048/A025049 = alternating compositions, ranked by A345167.
A056239 adds up prime indices, row sums of A112798, row lengths A001222.
A124010 = prime signature, sorted A118914.
A345164 = alternating permutations of prime indices, complement A350251.
A349052/A129852/A129853 = weakly alternating compositions.
A349053 = non-weakly alternating compositions, ranked by A349057.
A349056 = weakly alternating permutations of prime indices.
A349058 = weakly alternating patterns, complement A350138.
A349060 = weakly alternating partitions, complement A349061.

Programs

  • Mathematica
    Select[Range[100],!SquareFreeQ[#]&&(PrimePowerQ[#]||And@@EvenQ/@Take[Last/@FactorInteger[#],{2,-2}])&]

A350140 Nonsquarefree numbers whose prime signature has at least one odd part other the first or last.

Original entry on oeis.org

60, 84, 120, 132, 140, 150, 156, 168, 204, 220, 228, 240, 260, 264, 270, 276, 280, 294, 300, 308, 312, 315, 336, 340, 348, 364, 372, 378, 380, 408, 420, 440, 444, 456, 460, 476, 480, 490, 492, 495, 516, 520, 528, 532, 540, 552, 560, 564, 572, 580, 585, 588
Offset: 1

Views

Author

Gus Wiseman, Dec 25 2021

Keywords

Comments

A number's prime signature (row n of A124010) is the sequence of positive exponents in its prime factorization.
Also Heinz numbers of non-weakly alternating non-strict integer partitions, where we define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. These partitions are counted by A349796. This sequence involves the somewhat degenerate case where no strict increases are allowed.

Examples

			The terms together with their Heinz partitions begin (A-E = 10-14):
     60: (3211)      276: (9211)      420: (43211)
     84: (4211)      280: (43111)     440: (53111)
    120: (32111)     294: (4421)      444: (C211)
    132: (5211)      300: (33211)     456: (82111)
    140: (4311)      308: (5411)      460: (9311)
    150: (3321)      312: (62111)     476: (7411)
    156: (6211)      315: (4322)      480: (3211111)
    168: (42111)     336: (421111)    490: (4431)
    204: (7211)      340: (7311)      492: (D211)
    220: (5311)      348: (A211)      495: (5322)
    228: (8211)      364: (6411)      516: (E211)
    240: (321111)    372: (B211)      520: (63111)
    260: (6311)      378: (42221)     528: (521111)
    264: (52111)     380: (8311)      532: (8411)
    270: (32221)     408: (72111)     540: (322211)
		

Crossrefs

Including all nonsquarefree numbers gives A013929, complement A005117.
Subsets include A088860 and A110286.
Signatures of this type are counted by A274230, complement A027383.
The strict instead of non-strict version is A336568, counted by A347548.
A version for compositions allowing strict is A349057, counted by A349053.
Allowing strict partitions gives A349794, counted by A349061.
These partitions are counted by A349796.
The complement in nonsquarefree partitions is A350137, counted by A349795.
A000041 = integer partitions, strict A000009.
A001250 = alternating permutations, ranked by A349051, complement A348615.
A003242 = Carlitz (anti-run) compositions.
A025047/A025048/A025049 = alternating compositions, ranked by A345167.
A056239 adds up prime indices, row sums of A112798, row lengths A001222.
A096441 = weakly alternating 0-appended partitions.
A124010 = prime signature, sorted A118914.
A345164 = alternating permutations of prime indices, complement A350251.
A345170 = partitions w/ an alternating permutation, ranked by A345172.
A349052/A129852/A129853 = weakly alternating compositions.
A349056 = weakly alternating permutations of prime indices.
A349058 = weakly alternating patterns, complement A350138.
A349060 = weakly alternating partitions, strong A349801.
A349798 = weakly but not strongly alternating perms of prime indices.

Programs

  • Mathematica
    Select[Range[300],!SquareFreeQ[#]&&PrimeNu[#]>1&& !And@@EvenQ/@Take[Last/@FactorInteger[#],{2,-2}]&]

Formula

Complement of A005117 in A349794.

A179080 Number of partitions of n into distinct parts where all differences between consecutive parts are odd.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 4, 2, 6, 4, 7, 5, 9, 8, 12, 10, 14, 15, 17, 19, 22, 26, 26, 32, 32, 42, 40, 52, 48, 66, 59, 79, 73, 98, 89, 118, 108, 143, 133, 170, 160, 204, 194, 241, 236, 286, 283, 336, 339, 396, 407, 464, 483, 544, 575, 634, 681, 740, 803, 862, 944, 1001, 1110, 1162, 1296, 1348, 1512, 1561, 1760, 1805
Offset: 0

Views

Author

Joerg Arndt, Jan 04 2011

Keywords

Examples

			From _Joerg Arndt_, Oct 27 2012:  (Start)
The a(18) = 15 such partitions of 18 are:
[ 1]  1 2 3 12
[ 2]  1 2 5 10
[ 3]  1 2 7 8
[ 4]  1 2 15
[ 5]  1 4 5 8
[ 6]  1 4 13
[ 7]  1 6 11
[ 8]  1 8 9
[ 9]  2 3 4 9
[10]  2 3 6 7
[11]  3 4 5 6
[12]  3 4 11
[13]  3 6 9
[14]  5 6 7
[15]  18
(End)
		

Crossrefs

Cf. A179049 (odd differences and odd minimal part).
Cf. A189357 (even differences, distinct parts), A096441 (even differences).
Cf. A000009 (partitions of 2*n with even differences and even minimal part).

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i>n, 0, b(n, i+2)+b(n-i, i+1)))
        end:
    a:= n-> `if`(n=0, 1, b(n, 1)+b(n, 2)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Nov 08 2012; revised Feb 24 2020
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n==0, 1, If[i<1, 0, b[n, i-1, t] + If[i <= n && Mod[i, 2] != t, b[n-i, i-1, Mod[i, 2]], 0]]]; a[n_] := If[n==0, 1, Sum[b[n-i, i-1, Mod[i, 2]], {i, 1, n}]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Mar 24 2015, after Alois P. Heinz *)
    Join[{1},Table[Length[Select[IntegerPartitions[n],Max[Length/@Split[#]]==1 && AllTrue[ Differences[#],OddQ]&]],{n,70}]] (* Harvey P. Dale, Jun 25 2022 *)
  • PARI
    N=66; x='x+O('x^N); gf = sum(n=0,N, x^(n*(n+1)/2) / prod(k=1,n+1, 1-x^(2*k) ) ); Vec( gf ) /* Joerg Arndt, Jan 29 2011 */
  • Sage
    def A179080(n):
        odd_diffs = lambda x: all(abs(d) % 2 == 1 for d in differences(x))
        satisfies = lambda p: not p or odd_diffs(p)
        def count(pred, iter): return sum(1 for item in iter if pred(item))
        return count(satisfies, Partitions(n, max_slope=-1))
    print([A179080(n) for n in range(0, 20)]) # show first terms
    
  • Sage
    # Alternative after Alois P. Heinz:
    def A179080(n):
        @cached_function
        def h(n, k):
            if n == 0: return 1
            if k  > n: return 0
            return h(n, k+2) + h(n-k, k+1)
        return h(n, 1) + h(n, 2) if n > 0 else 1
    print([A179080(n) for n in range(71)]) # Peter Luschny, Feb 25 2020
    

Formula

G.f.: sum(n>=0, x^(n*(n+1)/2) / prod(k=1..n+1, 1-x^(2*k) ) ). - Joerg Arndt, Jan 29 2011
a(n) = A179049(n) + A218355(n). - Joerg Arndt, Oct 27 2012

A351594 Number of odd-length integer partitions y of n that are alternately constant, meaning y_i = y_{i+1} for all odd i.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 4, 2, 7, 3, 9, 4, 13, 6, 19, 6, 26, 10, 35, 12, 49, 16, 64, 20, 87, 27, 115, 32, 151, 44, 195, 53, 256, 69, 328, 84, 421, 108, 537, 130, 682, 167, 859, 202, 1085, 252, 1354, 305, 1694, 380, 2104, 456, 2609, 564, 3218, 676, 3968, 826, 4863
Offset: 0

Views

Author

Gus Wiseman, Feb 24 2022

Keywords

Comments

These are partitions with all even run-lengths except for the last, which is odd.

Examples

			The a(1) = 1 through a(9) = 7 partitions:
  (1)  (2)  (3)    (4)  (5)      (6)    (7)        (8)    (9)
            (111)       (221)    (222)  (331)      (332)  (333)
                        (11111)         (22111)           (441)
                                        (1111111)         (22221)
                                                          (33111)
                                                          (2211111)
                                                          (111111111)
		

Crossrefs

The ordered version (compositions) is A016116 shifted right once.
All odd-length partitions are counted by A027193.
The opposite version is A117409, even-length A351012, any length A351003.
Replacing equal with unequal relations appears to give:
- any length: A122129
- odd length: A122130
- even length: A351008
- opposite any length: A122135
- opposite odd length: A351595
- opposite even length: A122134
This is the odd-length case of A351004, even-length A035363.
The case that is also strict at even indices is:
- any length: A351005
- odd length: A351593
- even length: A035457
- opposite any length: A351006
- opposite odd length: A053251
- opposite even length: A351007
A reverse version is A096441; see also A349060.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],OddQ[Length[#]]&&And@@Table[#[[i]]==#[[i+1]],{i,1,Length[#]-1,2}]&]],{n,0,30}]

A097896 Number of compositions of n with either all parts odd or all parts even.

Original entry on oeis.org

1, 2, 2, 5, 5, 12, 13, 29, 34, 71, 89, 176, 233, 441, 610, 1115, 1597, 2840, 4181, 7277, 10946, 18735, 28657, 48416, 75025, 125489, 196418, 326003, 514229, 848424, 1346269, 2211077, 3524578, 5768423, 9227465, 15061424, 24157817, 39350313
Offset: 1

Views

Author

Dubois Marcel (dubois.ml(AT)club-internet.fr), Sep 03 2004

Keywords

Comments

Number of compositions of n with only even parts is 0 if n is odd, or 2^((n-2)/2) if n is even.

Examples

			For n=4: 1+1+1+1, 3+1, 1+3, 2+2, 4: total=5 so a(n)=5.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{}, Fibonacci[n] + If[EvenQ[n], 2^(n/2 - 1), 0]]; Table[ f[n], {n, 22}] (* Robert G. Wilson v, Sep 06 2004 *)
    LinearRecurrence[{1,3,-2,-2},{1,2,2,5},40] (* Harvey P. Dale, Nov 27 2012 *)

Formula

a(2*n-1) = Fibonacci(2*n-1), a(2*n) = 2^(n-1)+Fibonacci(2*n). - Vladeta Jovovic, Sep 05 2004
a(n)= +a(n-1) +3*a(n-2) -2*a(n-3) -2*a(n-4). G.f.: -x*(-1-x+x^3+3*x^2)/ ((2*x^2-1) * (x^2+x-1)). - R. J. Mathar, Feb 06 2010

Extensions

More terms from Robert G. Wilson v, Sep 06 2004
Previous Showing 21-28 of 28 results.