login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A320382 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are nonincreasing. 9

%I #21 Jan 07 2021 06:51:26

%S 1,1,1,2,2,3,4,4,5,7,7,8,10,10,12,16,14,16,20,20,23,27,26,29,35,34,38,

%T 44,43,48,55,53,59,68,67,74,83,79,88,100,98,106,118,117,127,142,139,

%U 149,164,165,179,192,191,206,226,224,240,260,257,277,301,299,319,344,346

%N Number of partitions of n into distinct parts such that the successive differences of consecutive parts are nonincreasing.

%C 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.

%H Fausto A. C. Cariboni, <a href="/A320382/b320382.txt">Table of n, a(n) for n = 0..1000</a> (terms 0..100 from Seiichi Manyama)

%e There are a(17) = 16 such partitions of 17:

%e 01: [17]

%e 02: [1, 16]

%e 03: [2, 15]

%e 04: [3, 14]

%e 05: [4, 13]

%e 06: [5, 12]

%e 07: [6, 11]

%e 08: [7, 10]

%e 09: [1, 6, 10]

%e 10: [8, 9]

%e 11: [1, 7, 9]

%e 12: [2, 6, 9]

%e 13: [2, 7, 8]

%e 14: [3, 6, 8]

%e 15: [4, 6, 7]

%e 16: [2, 4, 5, 6]

%e There are a(18) = 20 such partitions of 18:

%e 01: [18]

%e 02: [1, 17]

%e 03: [2, 16]

%e 04: [3, 15]

%e 05: [4, 14]

%e 06: [5, 13]

%e 07: [6, 12]

%e 08: [7, 11]

%e 09: [1, 6, 11]

%e 10: [8, 10]

%e 11: [1, 7, 10]

%e 12: [2, 6, 10]

%e 13: [1, 8, 9]

%e 14: [2, 7, 9]

%e 15: [3, 6, 9]

%e 16: [3, 7, 8]

%e 17: [4, 6, 8]

%e 18: [5, 6, 7]

%e 19: [1, 4, 6, 7]

%e 20: [3, 4, 5, 6]

%o (Ruby)

%o def partition(n, min, max)

%o return [[]] if n == 0

%o [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}

%o end

%o def f(n)

%o return 1 if n == 0

%o cnt = 0

%o partition(n, 1, n).each{|ary|

%o ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}

%o cnt += 1 if ary0.sort == ary0

%o }

%o cnt

%o end

%o def A320382(n)

%o (0..n).map{|i| f(i)}

%o end

%o p A320382(50)

%Y Cf. A179255, A320385.

%K nonn

%O 0,4

%A _Seiichi Manyama_, Oct 12 2018

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)