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.

A320387 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are nonincreasing, and first difference <= first part.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 2, 2, 4, 3, 4, 5, 3, 5, 7, 4, 7, 8, 6, 8, 11, 7, 9, 13, 9, 11, 16, 12, 15, 18, 13, 17, 20, 17, 21, 24, 19, 24, 30, 22, 28, 34, 26, 34, 38, 30, 37, 43, 37, 42, 48, 41, 50, 58, 48, 55, 64, 53, 64, 71, 59, 73, 81, 69, 79, 89, 79, 90, 101, 87, 100, 111
Offset: 0

Views

Author

Seiichi Manyama, Oct 12 2018

Keywords

Comments

Partitions are usually written with parts in descending order, but the conditions are easier to check "visually" if written in ascending order.
Generating function of the "second integrals" of partitions: given a partition (p_1, ..., p_s) written in weakly decreasing order, write the sequence B = (b_1, b_2, ..., b_s) = (p_1, p_1 + p_2, ..., p_1 + ... + p_s). The sequence gives the coefficients of the generating function summing q^(b_1 + ... + b_s) over all partitions of all nonnegative integers. - William J. Keith, Apr 23 2022
From Gus Wiseman, Jan 17 2023: (Start)
Equivalently, a(n) is the number of multisets (weakly increasing sequences of positive integers) with weighted sum n. For example, the Heinz numbers of the a(0) = 1 through a(15) = 7 multisets are:
1 2 3 4 7 6 8 10 15 12 16 18 20 26 24 28
5 11 9 17 19 14 21 22 27 41 30 32
13 23 29 31 33 55 39 34
25 35 37 43 45
49 77 47
65
121
These multisets are counted by A264034. The reverse version is A007294. The zero-based version is A359678.
(End)

Examples

			There are a(29) = 15 such partitions of 29:
  01: [29]
  02: [10, 19]
  03: [11, 18]
  04: [12, 17]
  05: [13, 16]
  06: [14, 15]
  07: [5, 10, 14]
  08: [6, 10, 13]
  09: [6, 11, 12]
  10: [7, 10, 12]
  11: [8, 10, 11]
  12: [3, 6, 9, 11]
  13: [5, 7, 8, 9]
  14: [2, 4, 6, 8, 9]
  15: [3, 5, 6, 7, 8]
There are a(30) = 18 such partitions of 30:
  01: [30]
  02: [10, 20]
  03: [11, 19]
  04: [12, 18]
  05: [13, 17]
  06: [14, 16]
  07: [5, 10, 15]
  08: [6, 10, 14]
  09: [6, 11, 13]
  10: [7, 10, 13]
  11: [7, 11, 12]
  12: [8, 10, 12]
  13: [3, 6, 9, 12]
  14: [9, 10, 11]
  15: [4, 7, 9, 10]
  16: [2, 4, 6, 8, 10]
  17: [6, 7, 8, 9]
  18: [4, 5, 6, 7, 8]
		

Crossrefs

Number of appearances of n > 0 in A304818, reverse A318283.
A053632 counts compositions by weighted sum.
A358194 counts partitions by weighted sum, reverse A264034.
Weighted sum of prime indices: A359497, A359676, A359682, A359754, A359755.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ots[y_]:=Sum[i*y[[i]],{i,Length[y]}];
    Table[Length[Select[Range[2^n],ots[prix[#]]==n&]],{n,10}] (* Gus Wiseman, Jan 17 2023 *)
  • PARI
    seq(n)={Vec(sum(k=1, (sqrtint(8*n+1)+1)\2, my(t=binomial(k,2)); x^t/prod(j=1, k-1, 1 - x^(t-binomial(j,2)) + O(x^(n-t+1)))))} \\ Andrew Howroyd, Jan 22 2023
  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary << 0
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0
      }
      cnt
    end
    def A320387(n)
      (0..n).map{|i| f(i)}
    end
    p A320387(50)
    

Formula

G.f.: Sum_{k>=1} x^binomial(k,2)/Product_{j=1..k-1} (1 - x^(binomial(k,2)-binomial(j,2))). - Andrew Howroyd, Jan 22 2023

A320466 Number of partitions of n such that the successive differences of consecutive parts are nonincreasing.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 7, 7, 9, 12, 12, 13, 18, 17, 21, 25, 24, 27, 34, 33, 38, 44, 43, 47, 58, 56, 62, 70, 70, 78, 90, 84, 96, 109, 108, 118, 132, 127, 140, 158, 158, 167, 189, 185, 204, 221, 218, 236, 260, 261, 282, 301, 299, 322, 358, 350, 376, 405, 404, 432, 472, 466, 500
Offset: 0

Views

Author

Seiichi Manyama, Oct 13 2018

Keywords

Comments

Partitions are usually written with parts in descending order, but the conditions are easier to check "visually" if written in ascending order.
Partitions (p(1), p(2), ..., p(m)) such that p(k-1) - p(k-2) >= p(k) - p(k-1) for all k >= 3.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (6,3,1) are (-3,-2). Then a(n) is the number of integer partitions of n whose differences are weakly decreasing. The Heinz numbers of these partitions are given by A325361. Of course, the number of such integer partitions of n is also the number of reversed integer partitions of n whose differences are weakly decreasing, which is the author's interpretation. - Gus Wiseman, May 03 2019

Examples

			There are a(10) = 12 such partitions of 10:
01: [10]
02: [1, 9]
03: [2, 8]
04: [3, 7]
05: [4, 6]
06: [5, 5]
07: [1, 4, 5]
08: [2, 4, 4]
09: [1, 2, 3, 4]
10: [1, 3, 3, 3]
11: [2, 2, 2, 2, 2]
12: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
There are a(11) = 13 such partitions of 11:
01: [11]
02: [1, 10]
03: [2, 9]
04: [3, 8]
05: [4, 7]
06: [5, 6]
07: [1, 4, 6]
08: [1, 5, 5]
09: [2, 4, 5]
10: [3, 4, 4]
11: [2, 3, 3, 3]
12: [1, 2, 2, 2, 2, 2]
13: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
		

Crossrefs

Cf. A320382 (distinct parts, nonincreasing).

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],GreaterEqual@@Differences[#]&]],{n,0,30}] (* Gus Wiseman, May 03 2019 *)
  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0
      }
      cnt
    end
    def A320466(n)
      (0..n).map{|i| f(i)}
    end
    p A320466(50)

A179254 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are strictly increasing.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 5, 6, 8, 9, 9, 13, 14, 15, 19, 21, 22, 28, 30, 32, 39, 42, 44, 54, 58, 61, 72, 77, 82, 96, 102, 108, 124, 133, 141, 160, 171, 180, 203, 218, 230, 256, 273, 289, 320, 342, 361, 395, 423, 447, 486, 520, 548, 594, 635, 669, 721, 769, 811, 871, 928, 978, 1044, 1114
Offset: 0

Views

Author

Joerg Arndt, Jan 05 2011

Keywords

Comments

Partitions into distinct parts (p(1), p(2), ..., p(m)) such that p(k-1) - p(k-2) < p(k) - p(k-1) for all k >= 3.

Examples

			There are a(17) = 21 such partitions of 17:
01:  [ 1 2 4 10 ]
02:  [ 1 2 5 9 ]
03:  [ 1 2 14 ]
04:  [ 1 3 13 ]
05:  [ 1 4 12 ]
06:  [ 1 5 11 ]
07:  [ 1 16 ]
08:  [ 2 3 12 ]
09:  [ 2 4 11 ]
10:  [ 2 5 10 ]
11:  [ 2 15 ]
12:  [ 3 4 10 ]
13:  [ 3 5 9 ]
14:  [ 3 14 ]
15:  [ 4 5 8 ]
16:  [ 4 13 ]
17:  [ 5 12 ]
18:  [ 6 11 ]
19:  [ 7 10 ]
20:  [ 8 9 ]
21:  [ 17 ]
- _Joerg Arndt_, Mar 31 2014
		

Crossrefs

Cf. A007294, A179255 (nondecreasing differences), A179269, A320382, A320385.
Cf. A240026 (partitions with nondecreasing differences), A240027 (partitions with strictly increasing differences).

Programs

  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0.reverse && ary0.uniq == ary0
      }
      cnt
    end
    def A179254(n)
      (0..n).map{|i| f(i)}
    end
    p A179254(50) # Seiichi Manyama, Oct 12 2018
  • Sage
    def A179254(n):
        has_increasing_diffs = lambda x: min(differences(x,2)) >= 1
        allowed = lambda x: len(x) < 3 or has_increasing_diffs(x)
        return len([x for x in Partitions(n,max_slope=-1) if allowed(x[::-1])])
    # D. S. McNeil, Jan 06 2011
    

A179269 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are increasing, and first difference > first part.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 5, 5, 5, 7, 7, 7, 10, 10, 10, 13, 14, 14, 18, 19, 19, 23, 25, 25, 30, 32, 33, 38, 41, 42, 48, 52, 54, 60, 65, 67, 75, 81, 84, 92, 99, 103, 113, 121, 126, 136, 147, 153, 165, 177, 184, 197, 213, 221, 236, 253, 264, 280, 301, 313, 331, 355, 371, 390, 418, 435, 458
Offset: 0

Views

Author

Joerg Arndt, Jan 05 2011

Keywords

Comments

Conditions as in A179254; additionally, if more than 1 part, first difference > first part.
Equivalently, number of partitions for which the sequence of part counts by decreasing part size is 1, 2, 3, ... - Olivier Gérard, Jul 28 2017

Examples

			a(10) = 5 as there are 5 such partitions of 10: 1 + 3 + 6 = 1 + 9 = 2 + 8 = 3 + 7 = 10.
a(10) = 5 as there are 5 such partitions of 10: 10, 8 + 1 + 1, 6 + 2 + 2, 4 + 3 + 3, 3 + 2 + 2 + 1 + 1 + 1 (second definition).
From _Gus Wiseman_, May 04 2019: (Start)
The a(3) = 1 through a(13) = 7 partitions whose differences are strictly increasing (with the last part taken to be 0) are the following (A = 10, B = 11, C = 12, D = 13). The Heinz numbers of these partitions are given by A325460.
  (3)  (4)   (5)   (6)   (7)   (8)   (9)   (A)    (B)    (C)    (D)
       (31)  (41)  (51)  (52)  (62)  (72)  (73)   (83)   (93)   (94)
                         (61)  (71)  (81)  (82)   (92)   (A2)   (A3)
                                           (91)   (A1)   (B1)   (B2)
                                           (631)  (731)  (831)  (C1)
                                                                (841)
                                                                (931)
The a(3) = 1 through a(11) = 5 partitions whose multiplicities form an initial interval of positive integers are the following (A = 10, B = 11). The Heinz numbers of these partitions are given by A307895.
  (3)  (4)    (5)    (6)    (7)    (8)    (9)    (A)       (B)
       (211)  (311)  (411)  (322)  (422)  (522)  (433)     (533)
                            (511)  (611)  (711)  (622)     (722)
                                                 (811)     (911)
                                                 (322111)  (422111)
(End)
		

Crossrefs

Cf. A179254 (condition only on differences), A007294 (nondecreasing instead of strictly increasing), A179255, A320382, A320385, A320387, A320388.

Programs

  • Mathematica
    Table[Length@
      Select[IntegerPartitions[n],
       And @@ Equal[Range[Length[Split[#]]], Length /@ Split[#]] &], {n,
    0, 40}]   (* Olivier Gérard, Jul 28 2017 *)
    Table[Length[Select[IntegerPartitions[n],Less@@Differences[Append[#,0]]&]],{n,0,30}] (* Gus Wiseman, May 04 2019 *)
  • PARI
    R(n)={my(L=List(), v=vectorv(n, i, 1), w=1, t=1); while(v, listput(L,v); w++; t+=w; v=vectorv(n, i, sum(k=1, (i-1)\t, L[w-1][i-k*t]))); Mat(L)}
    seq(n)={my(M=R(n)); concat([1], vector(n, i, vecsum(M[i,])))} \\ Andrew Howroyd, Aug 27 2019
  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary << 0
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0.reverse && ary0.uniq == ary0
      }
      cnt
    end
    def A179269(n)
      (0..n).map{|i| f(i)}
    end
    p A179269(50) # Seiichi Manyama, Oct 12 2018
    
  • Sage
    def A179269(n):
        has_increasing_diffs = lambda x: min(differences(x,2)) >= 1
        special = lambda x: (x[1]-x[0]) > x[0]
        allowed = lambda x: (len(x) < 2 or special(x)) and (len(x) < 3 or has_increasing_diffs(x))
        return len([x for x in Partitions(n,max_slope=-1) if allowed(x[::-1])])
    # D. S. McNeil, Jan 06 2011
    

Formula

G.f.: Sum_{k>=0} x^(k*(k+1)*(k+2)/6) / Product_{j=1..k} (1 - x^(j*(j+1)/2)) (conjecture). - Ilya Gutkovskiy, Apr 25 2019

A179255 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are nondecreasing.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 5, 5, 8, 9, 10, 13, 15, 16, 22, 24, 26, 33, 36, 39, 50, 54, 58, 70, 77, 83, 100, 109, 116, 137, 150, 159, 186, 202, 216, 249, 270, 288, 328, 355, 379, 428, 462, 491, 554, 597, 633, 707, 760, 807, 899, 964, 1020, 1127, 1211, 1282, 1412, 1512, 1596, 1750, 1873, 1976, 2160, 2305, 2434, 2652, 2826, 2978
Offset: 0

Views

Author

Joerg Arndt, Jan 05 2011

Keywords

Comments

Partitions into distinct parts (p(1), p(2), ..., p(m)) such that p(k-1) - p(k-2) <= p(k) - p(k-1) for all k >= 3.

Examples

			There are a(17) = 26 such partitions of 17:
01:  [ 1 2 3 4 7 ]
02:  [ 1 2 3 11 ]
03:  [ 1 2 4 10 ]  *
04:  [ 1 2 5 9 ]   *
05:  [ 1 2 14 ]   *
06:  [ 1 3 5 8 ]
07:  [ 1 3 13 ]   *
08:  [ 1 4 12 ]   *
09:  [ 1 5 11 ]   *
10:  [ 1 16 ]   *
11:  [ 2 3 4 8 ]
12:  [ 2 3 5 7 ]
13:  [ 2 3 12 ]   *
14:  [ 2 4 11 ]   *
15:  [ 2 5 10 ]   *
16:  [ 2 15 ]   *
17:  [ 3 4 10 ]   *
18:  [ 3 5 9 ]   *
19:  [ 3 14 ]   *
20:  [ 4 5 8 ]   *
21:  [ 4 13 ]   *
22:  [ 5 12 ]   *
23:  [ 6 11 ]   *
24:  [ 7 10 ]   *
25:  [ 8 9 ]   *
26:  [ 17 ]   *
The 21 partitions marked with * have strictly increasing differences, see the example for A179254.
- _Joerg Arndt_, Mar 31 2014
		

Crossrefs

Cf. A009994.
Cf. A179254 (strictly increasing differences), A179269, A007294.
Cf. A240026 (partitions with nondecreasing differences), A240027 (partitions with strictly increasing differences), A320382.

Programs

  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0.reverse
      }
      cnt
    end
    def A179255(n)
      (0..n).map{|i| f(i)}
    end
    p A179255(50) # Seiichi Manyama, Oct 12 2018
  • Sage
    def A179255(n):
        has_nondecreasing_diffs = lambda x: min(differences(x,2)) >= 0
        allowed = lambda x: len(x) < 3 or has_nondecreasing_diffs(x)
        return len([x for x in Partitions(n,max_slope=-1) if allowed(x[::-1])])
    # D. S. McNeil, Jan 06 2011
    

A320385 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are decreasing, and first difference < first part.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 2, 3, 4, 3, 3, 5, 3, 5, 6, 4, 5, 7, 5, 7, 8, 6, 7, 10, 8, 9, 11, 8, 11, 13, 9, 13, 15, 12, 14, 17, 13, 16, 20, 15, 18, 22, 18, 21, 25, 20, 23, 27, 23, 28, 30, 26, 30, 34, 30, 33, 38, 31, 38, 43, 36, 42, 46, 42, 47, 50, 45, 50, 58, 51, 55
Offset: 0

Views

Author

Seiichi Manyama, Oct 12 2018

Keywords

Examples

			There are a(29) = 10 such partitions of 29:
01: [29]
02: [10, 19]
03: [11, 18]
04: [12, 17]
05: [13, 16]
06: [14, 15]
07: [6, 10, 13]
08: [6, 11, 12]
09: [7, 10, 12]
10: [8, 10, 11]
There are a(30) = 8 such partitions of 30:
01: [30]
02: [11, 19]
03: [12, 18]
04: [13, 17]
05: [14, 16]
06: [6, 11, 13]
07: [7, 11, 12]
08: [4, 7, 9, 10]
		

Crossrefs

Programs

  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary << 0
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0 && ary0.uniq == ary0
      }
      cnt
    end
    def A320385(n)
      (0..n).map{|i| f(i)}
    end
    p A320385(50)

A342519 Number of strict integer partitions of n with weakly decreasing first quotients.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 5, 5, 7, 8, 9, 12, 14, 15, 18, 18, 21, 25, 29, 32, 38, 40, 44, 51, 57, 61, 66, 73, 77, 89, 97, 104, 115, 124, 135, 147, 160, 174, 193, 206, 218, 238, 254, 272, 293, 313, 331, 353, 381, 408, 436, 468, 499, 532, 569, 610, 651, 694, 735, 783
Offset: 0

Views

Author

Gus Wiseman, Mar 20 2021

Keywords

Comments

Also called log-concave-down strict partitions.
Also the number of reversed strict partitions of n with weakly decreasing first quotients.
The first quotients of a sequence are defined as if the sequence were an increasing divisor chain, so for example the first quotients of (6,3,1) are (1/2,1/3).

Examples

			The strict partition (10,7,4,2,1) has first quotients (7/10,4/7,1/2,1/2) so is counted under a(24), even though the first differences (-3,-3,-2,-1) are weakly increasing.
The a(1) = 1 through a(13) = 14 strict partitions (A..D = 10..13):
  1   2   3    4    5    6     7     8     9     A      B     C      D
          21   31   32   42    43    53    54    64     65    75     76
                    41   51    52    62    63    73     74    84     85
                         321   61    71    72    82     83    93     94
                               421   431   81    91     92    A2     A3
                                           432   541    A1    B1     B2
                                           531   631    542   543    C1
                                                 4321   641   642    652
                                                        731   651    742
                                                              741    751
                                                              831    841
                                                              5421   931
                                                                     5431
                                                                     6421
		

Crossrefs

The non-strict ordered version is A069916.
The version for differences instead of quotients is A320382.
The non-strict version is A342513 (ranking: A342526).
The weakly increasing version is A342516.
The strictly decreasing version is A342518.
A000005 counts constant partitions.
A000041 counts partitions (strict: A000009).
A000929 counts partitions with all adjacent parts x >= 2y.
A001055 counts factorizations (strict: A045778, ordered: A074206).
A003238 counts chains of divisors summing to n - 1 (strict: A122651).
A057567 counts strict chains of divisors with weakly increasing quotients.
A167865 counts strict chains of divisors > 1 summing to n.
A342094 counts partitions with all adjacent parts x <= 2y (strict: A342095).
A342528 counts compositions with alternately weakly increasing parts.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&GreaterEqual@@Divide@@@Reverse/@Partition[#,2,1]&]],{n,0,30}]

A320388 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are decreasing.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 8, 7, 9, 11, 10, 12, 15, 14, 16, 19, 18, 21, 25, 23, 26, 31, 29, 33, 38, 36, 40, 46, 44, 49, 56, 53, 58, 66, 64, 70, 77, 76, 82, 92, 89, 96, 106, 104, 113, 123, 120, 130, 142, 141, 149, 162, 160, 172, 186, 184, 195, 211, 210, 223, 238
Offset: 0

Views

Author

Seiichi Manyama, Oct 12 2018

Keywords

Comments

Partitions are usually written with parts in descending order, but the conditions are easier to check "visually" if written in ascending order.
Partitions into distinct parts (p(1), p(2), ..., p(m)) such that p(k-1) - p(k-2) > p(k) - p(k-1) for all k >= 3.

Examples

			There are a(17) = 15 such partitions of 17:
  01: [17]
  02: [1, 16]
  03: [2, 15]
  04: [3, 14]
  05: [4, 13]
  06: [5, 12]
  07: [6, 11]
  08: [7, 10]
  09: [1, 6, 10]
  10: [8, 9]
  11: [1, 7, 9]
  12: [2, 6, 9]
  13: [2, 7, 8]
  14: [3, 6, 8]
  15: [4, 6, 7]
There are a(18) = 14 such partitions of 18:
  01: [18]
  02: [1, 17]
  03: [2, 16]
  04: [3, 15]
  05: [4, 14]
  06: [5, 13]
  07: [6, 12]
  08: [7, 11]
  09: [8, 10]
  10: [1, 7, 10]
  11: [1, 8, 9]
  12: [2, 7, 9]
  13: [3, 7, 8]
  14: [1, 4, 6, 7]
		

Crossrefs

Programs

  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0 && ary0.uniq == ary0
      }
      cnt
    end
    def A320388(n)
      (0..n).map{|i| f(i)}
    end
    p A320388(50)
Showing 1-8 of 8 results.