A151798 a(0)=1, a(1)=2, a(n)=4 for n>=2.
1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 0
Links
- David Applegate, The movie version
- Index entries for linear recurrences with constant coefficients, signature (1).
Programs
-
Magma
[ n le 1 select n+1 else 4: n in [0..104] ];
-
Mathematica
f[n_] := Fold[#2*Floor[#1/#2 + 1/2] &, n, Reverse@ Range[n - 1]]; Array[f, 55]
-
PARI
Vec((1+x+2*x^2)/(1-x) + O(x^100)) \\ Altug Alkan, Jan 19 2016
Formula
G.f.: (1+x+2*x^2)/(1-x).
E.g.f. A(x)=x*B(x) satisfies the differential equation B'(x)=1+x+x^2+B(x). - Vladimir Kruchinin, Jan 19 2011
E.g.f.: 4*exp(x) - 2*x - 3. - Elmo R. Oliveira, Aug 06 2024
Comments