A254667 The nonnegative numbers with 2 instead of 1.
0, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62
Offset: 0
Examples
G.f. = 2*x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 6*x^6 + 7*x^7 + 8*x^8 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..2500
- Index entries for linear recurrences with constant coefficients, signature (2,-1).
Crossrefs
Programs
-
Magma
m:=25; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!((2*x-2*x^2+x^3)/(1-x)^2)); // G. C. Greubel, Aug 03 2018 -
Mathematica
CoefficientList[Series[(2*x-2*x^2+x^3)/(1-x)^2, {x, 0, 60}], x] (* G. C. Greubel, Aug 03 2018 *) a[ n_] := n + Boole[n == 1]; (* Michael Somos, Aug 19 2018 *) Join[{0,2},Range[2,70]] (* Harvey P. Dale, Oct 10 2024 *)
-
PARI
{a(n) = n + (n==1)}; /* Michael Somos, Feb 09 2015 */
Formula
G.f.: (2*x - 2*x^2 + x^3) / (1 - x)^2. - Michael Somos, Feb 09 2015
Comments