A065033 1 appears three times, other numbers twice.
1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35
Offset: 0
Links
- Harry J. Smith, Table of n, a(n) for n = 0..1000
- Andrei Asinowski, Cyril Banderier, and Valerie Roitner, Generating functions for lattice paths with several forbidden patterns, (2019).
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
Programs
-
Haskell
a065033 n = 0 ^ n + div (n + 1) 2 -- Reinhard Zumkeller, Feb 27 2015
-
Mathematica
Array[Floor[#/2] &, 61] /. 0 -> 1 (* Michael De Vlieger, Mar 10 2020 *)
-
PARI
a(n) = { if (n<1, n==0, (n+1)\2) } \\ Harry J. Smith, Oct 03 2009
Formula
From Philippe Deléham, Sep 28 2006: (Start)
a(n) = a(n-1)+a(n-2)-a(n-3) for n>3.
G.f.: (1-x^2+x^3)/(1-x-x^2+x^3). (End)
a(n) = floor((n+1)/2) + 0^n. - Reinhard Zumkeller, Feb 27 2015
E.g.f.: (2 + exp(x)*x + sinh(x))/2. - Stefano Spezia, Aug 05 2025
Comments