login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A325558 Number of compositions of n with equal circular differences up to sign. 9
1, 2, 4, 5, 6, 10, 8, 16, 13, 16, 18, 32, 20, 30, 30, 57, 34, 52, 46, 96, 74, 86, 84, 174, 119, 170, 192, 306, 244, 332, 372, 628, 560, 694, 812, 1259, 1228, 1566, 1852, 2696, 2806, 3538, 4260, 5894, 6482, 8098, 9890, 13392, 15049, 18706, 23018, 30298, 35198 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

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

The circular differences of a composition c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2).

LINKS

Andrew Howroyd, Table of n, a(n) for n = 1..200

Gus Wiseman, Sequences counting and ranking integer partitions by the differences of their successive parts.

EXAMPLE

The a(1) = 1 through a(8) = 16 compositions:

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

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

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

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

                    (1111)  (41)     (42)      (43)       (44)

                            (11111)  (51)      (52)       (53)

                                     (222)     (61)       (62)

                                     (1212)    (1111111)  (71)

                                     (2121)               (1232)

                                     (111111)             (1313)

                                                          (2123)

                                                          (2222)

                                                          (2321)

                                                          (3131)

                                                          (3212)

                                                          (11111111)

MATHEMATICA

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

PROG

(PARI)

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])) )}

w(n, k, s)={my(R=matrix(n, n, i, j, i==j&&abs(i-k)==s), t=0); while(R, R=step(R, n, s); t+=R[n, k]); t}

a(n) = {numdiv(max(1, n)) + sum(s=1, n-1, sum(k=1, n, w(n, k, s)))} \\ Andrew Howroyd, Aug 22 2019

CROSSREFS

Cf. A000079, A008965, A047966, A049988, A098504, A173258, A175342, A325553, A325557, A325588, A325589.

Sequence in context: A014224 A175342 A077312 * A140779 A117890 A108853

Adjacent sequences:  A325555 A325556 A325557 * A325559 A325560 A325561

KEYWORD

nonn

AUTHOR

Gus Wiseman, May 11 2019

EXTENSIONS

a(26)-a(42) from Lars Blomberg, May 30 2019

Terms a(43) and beyond from Andrew Howroyd, Aug 22 2019

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 October 18 15:41 EDT 2019. Contains 328162 sequences. (Running on oeis4.)