login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A320388 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are decreasing. 3
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

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.

LINKS

Seiichi Manyama, Table of n, a(n) for n = 0..100

EXAMPLE

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]

PROG

(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)

CROSSREFS

Cf. A007294, A179254, A179255, A179269, A320382, A320385, A320387.

Cf. A081489.

Sequence in context: A241951 A084630 A325393 * A264396 A007360 A029144

Adjacent sequences:  A320385 A320386 A320387 * A320389 A320390 A320391

KEYWORD

nonn

AUTHOR

Seiichi Manyama, Oct 12 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 1 02:00 EDT 2020. Contains 333153 sequences. (Running on oeis4.)