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!)
A325557 Number of compositions of n with equal differences up to sign. 20

%I #12 Aug 24 2019 11:50:55

%S 1,1,2,4,6,8,13,12,20,24,25,29,49,40,50,64,86,80,105,102,164,175,186,

%T 208,325,316,382,476,624,660,814,961,1331,1500,1739,2140,2877,3274,

%U 3939,4901,6345,7448,9054,11157,14315,17181,20769,25843,32947,39639,48257,60075

%N Number of compositions of n with equal differences up to sign.

%C A composition of n is a finite sequence of positive integers summing to n.

%C The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1).

%H Andrew Howroyd, <a href="/A325557/b325557.txt">Table of n, a(n) for n = 0..200</a>

%H Gus Wiseman, <a href="/A325325/a325325.txt">Sequences counting and ranking integer partitions by the differences of their successive parts.</a>

%e The a(1) = 1 through a(8) = 20 compositions:

%e (1) (2) (3) (4) (5) (6) (7) (8)

%e (11) (12) (13) (14) (15) (16) (17)

%e (21) (22) (23) (24) (25) (26)

%e (111) (31) (32) (33) (34) (35)

%e (121) (41) (42) (43) (44)

%e (1111) (131) (51) (52) (53)

%e (212) (123) (61) (62)

%e (11111) (141) (151) (71)

%e (222) (232) (161)

%e (321) (313) (242)

%e (1212) (12121) (323)

%e (2121) (1111111) (1232)

%e (111111) (1313)

%e (2123)

%e (2222)

%e (2321)

%e (3131)

%e (3212)

%e (21212)

%e (11111111)

%t Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Abs[Differences[#]]&]],{n,0,15}]

%o (PARI)

%o step(R,n,s)={matrix(n, n, i, j, if(i>j, if(j>s, R[i-j, j-s]) + if(j+s<=n, R[i-j, j+s])) )}

%o w(n,s)={my(R=matid(n), t=0); while(R, R=step(R,n,s); t+=vecsum(R[n,])); t}

%o a(n) = {numdiv(max(1,n)) + sum(s=1, n-1, w(n,s))} \\ _Andrew Howroyd_, Aug 22 2019

%Y Cf. A000079, A047966, A049988, A070211, A098504, A173258, A175342, A325545, A325546, A325547, A325548, A325552, A325558.

%K nonn

%O 0,3

%A _Gus Wiseman_, May 11 2019

%E a(26)-a(42) from _Lars Blomberg_, May 30 2019

%E Terms a(43) and beyond from _Andrew Howroyd_, Aug 22 2019

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 19 23:40 EDT 2024. Contains 371798 sequences. (Running on oeis4.)