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!)
A238423 Number of compositions of n avoiding three consecutive parts in arithmetic progression. 15
1, 1, 2, 3, 7, 13, 22, 42, 81, 149, 278, 516, 971, 1812, 3374, 6297, 11770, 21970, 41002, 76523, 142901, 266779, 497957, 929563, 1735418, 3239698, 6047738, 11289791, 21076118, 39344992, 73448769, 137113953, 255965109, 477835991, 892023121, 1665227859 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

These are compositions of n whose second-differences are nonzero. - Gus Wiseman, Jun 03 2019

LINKS

Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 0..400

Wikipedia, Arithmetic progression

FORMULA

a(n) ~ c * d^n, where d = 1.866800016014240677813344121155900699..., c = 0.540817940878009616510727217687704495... - Vaclav Kotesovec, May 01 2014

EXAMPLE

The a(5) = 13 such compositions are:

01:  [ 1 1 2 1 ]

02:  [ 1 1 3 ]

03:  [ 1 2 1 1 ]

04:  [ 1 2 2 ]

05:  [ 1 3 1 ]

06:  [ 1 4 ]

07:  [ 2 1 2 ]

08:  [ 2 2 1 ]

09:  [ 2 3 ]

10:  [ 3 1 1 ]

11:  [ 3 2 ]

12:  [ 4 1 ]

13:  [ 5 ]

MAPLE

# b(n, r, d): number of compositions of n where the leftmost part j

#             does not have distance d to the recent part r

b:= proc(n, r, d) option remember; `if`(n=0, 1,

      add(`if`(j=r+d, 0, b(n-j, j, j-r)), j=1..n))

    end:

a:= n-> b(n, infinity, 0):

seq(a(n), n=0..45);

MATHEMATICA

b[n_, r_, d_] := b[n, r, d] = If[n == 0, 1, Sum[If[j == r + d, 0, b[n - j, j, j - r]], {j, 1, n}]]; a[n_] := b[n, Infinity, 0]; Table[a[n], {n, 0, 45}] (* Jean-Fran├žois Alcover, Nov 06 2014, after Maple *)

Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !MemberQ[Differences[#, 2], 0]&]], {n, 0, 10}] (* Gus Wiseman, Jun 03 2019 *)

CROSSREFS

Cf. A238424 (equivalent for partitions).

Cf. A238569 (equivalent for any 3-term arithmetic progression).

Cf. A238686, A295370.

Cf. A007862, A049988, A175342, A325545, A325849, A325851, A325874, A325875.

Sequence in context: A048216 A003509 A238432 * A133370 A237283 A332861

Adjacent sequences:  A238420 A238421 A238422 * A238424 A238425 A238426

KEYWORD

nonn

AUTHOR

Joerg Arndt and Alois P. Heinz, Feb 26 2014

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 6 09:57 EDT 2020. Contains 333273 sequences. (Running on oeis4.)