A214997 Power ceiling-floor sequence of 2+sqrt(2).
4, 13, 45, 153, 523, 1785, 6095, 20809, 71047, 242569, 828183, 2827593, 9654007, 32960841, 112535351, 384219721, 1311808183, 4478793289, 15291556791, 52208640585, 178251448759, 608588513865, 2077851157943, 7094227604041, 24221208100279, 82696377193033
Offset: 0
Examples
a(0) = ceiling(r) = 4, where r = 2+sqrt(2); a(1) = floor(4*r) = 13; a(2) = ceiling(13*r) = 45.
Links
- Clark Kimberling, Table of n, a(n) for n = 0..250
- Index entries for linear recurrences with constant coefficients, signature (3,2,-2).
Programs
-
Magma
Q:=Rationals(); R
:=PowerSeriesRing(Q, 40); Coefficients(R!((4 +x-2*x^2)/(1-3*x-2*x^2+2*x^3))); // G. C. Greubel, Feb 01 2018 -
Mathematica
(See A214996.) CoefficientList[Series[(4+x-2*x^2)/(1-3*x-2*x^2+2*x^3), {x,0,50}], x] (* G. C. Greubel, Feb 01 2018 *)
-
PARI
Vec((4 + x - 2*x^2) / ((1 + x)*(1 - 4*x + 2*x^2)) + O(x^40)) \\ Colin Barker, Nov 13 2017
Formula
a(n) = floor(x*a(n-1)) if n is odd, a(n) = ceiling(x*a(n-1)) if n is even, where x = 2+sqrt(2) and a(0) = ceiling(x).
a(n) = 3*a(n-1) + 2*a(n-2) - 2*a(n-3).
G.f.: (4 + x - 2*x^2)/(1 - 3*x - 2*x^2 + 2*x^3).
a(n) = (1/14)*(2*(-1)^n + (27-19*sqrt(2))*(2-sqrt(2))^n + (2+sqrt(2))^n*(27+19*sqrt(2))). - Colin Barker, Nov 13 2017
Comments