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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A173258 Number of compositions of n where differences between neighboring parts are in {-1,1}. 3
1, 1, 1, 3, 2, 4, 5, 5, 7, 10, 9, 14, 16, 19, 24, 31, 35, 45, 55, 66, 84, 104, 124, 156, 192, 236, 292, 363, 444, 551, 681, 839, 1040, 1287, 1586, 1967, 2430, 3001, 3717, 4597, 5683, 7034, 8697, 10758, 13312, 16469, 20369, 25204, 31180, 38574, 47726, 59047 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..1000

FORMULA

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

EXAMPLE

a(3) = 3: [3], [2,1], [1,2].

a(4) = 2: [4], [1,2,1].

a(5) = 4: [5], [3,2], [2,3], [2,1,2].

a(6) = 5: [6], [3,2,1], [2,1,2,1], [1,2,3], [1,2,1,2].

MAPLE

b:= proc(n, i) option remember;

      `if`(n<1 or i<1, 0, `if`(n=i, 1, add(b(n-i, i+j), j=[-1, 1])))

    end:

a:= n-> `if`(n=0, 1, add(b(n, j), j=1..n)):

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

MATHEMATICA

b[n_, i_] := b[n, i] = If[n < 1 || i < 1, 0, If[n == i, 1, Sum[b[n - i, i + j], {j, {-1, 1}}]]]; a[n_] := If[n == 0, 1, Sum[b[n, j], {j, 1, n}]]; Table[a[n], {n, 0, 70}] // Flatten (* Jean-Fran├žois Alcover, Dec 13 2013, translated from Maple *)

CROSSREFS

Column k=1 of A214247, A214249.

Sequence in context: A286298 A128440 A063201 * A039858 A035558 A089401

Adjacent sequences:  A173255 A173256 A173257 * A173259 A173260 A173261

KEYWORD

nonn

AUTHOR

Alois P. Heinz, Jul 08 2012

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified August 22 22:22 EDT 2017. Contains 290952 sequences.