cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A289692 The number of partitions of [n] with exactly 2 blocks without peaks.

Original entry on oeis.org

0, 1, 2, 4, 8, 15, 27, 48, 85, 150, 264, 464, 815, 1431, 2512, 4409, 7738, 13580, 23832, 41823, 73395, 128800, 226029, 396654, 696080, 1221536, 2143647, 3761839, 6601568, 11584945
Offset: 1

Views

Author

R. J. Mathar, Jul 09 2017

Keywords

Crossrefs

Cf. A005251 (first differences), A289693 (3 blocks), A289694 (4 blocks).

Programs

  • GAP
    a:=[0, 1, 2, 4]; for n in [5..10^2] do a[n]:=3*a[n-1]-3*a[n-2]+2*a[n-3]-a[n-4]; od; a; # Muniru A Asiru, Jan 25 2018
    
  • Magma
    I:=[0, 1, 2, 4]; [n le 4 select I[n] else 3*Self(n-1)-3*Self(n-2)+2*Self(n-3)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jan 26 2018
  • Maple
    a := proc(n) option remember: if n = 1 then 0 elif n = 2 then 1 elif n=3 then 2 elif n=4 then 4 elif  n >= 5 then 3*procname(n-1) -3*procname(n-2)+2*procname(n-3)-procname(n-4) fi; end:
    seq(a(n), n = 0..100); # Muniru A Asiru, Jan 25 2018
  • Mathematica
    LinearRecurrence[{3, -3, 2, -1}, {0, 1, 2, 4}, 40] (* Vincenzo Librandi, Jan 26 2018 *)

Formula

From Colin Barker, Nov 07 2017: (Start)
G.f.: x^2*(1 - x + x^2) / ((1 - x)*(1 - 2*x + x^2 - x^3)).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) - a(n-4) for n>4. (End)
a(n) = A077855(n-2) - A005314(n-2) for n>1. - John Molokach, Jan 23 2018
a(n) - a(n-1) = A005251(n). - R. J. Mathar, Mar 11 2021