login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A143795
a(1) = 1, then for n > 1, a(n) = a(n - 1) + 1 for n even, or a(n) = a(n - 1) + 10 for n odd.
0
1, 2, 12, 13, 23, 24, 34, 35, 45, 46, 56, 57, 67, 68, 78, 79, 89, 90, 100, 101, 111, 112, 122, 123, 133, 134, 144, 145, 155, 156, 166, 167, 177, 178, 188, 189, 199, 200, 210, 211, 221, 222, 232, 233, 243, 244, 254, 255, 265, 266, 276, 277, 287, 288, 298, 299
OFFSET
1,2
COMMENTS
Old name was "Start with 1; then repeatedly add 1, then add 10."
FORMULA
From R. J. Mathar, Sep 04 2008: (Start)
a(n) = (22*n - 27 - 9*(-1)^n)/4.
G.f.: x*(1 + x + 9*x^2)/((1+x)(1-x)^2).
a(n) = a(n-2) + 11. (End)
a(n) = 11*n - a(n-1) - 19 (with a(1)=1). - Vincenzo Librandi, Nov 25 2010
MATHEMATICA
Rest@ CoefficientList[Series[x (1 + x + 9 x^2)/((1 + x) (1 - x)^2), {x, 0, 56}], x] (* or *)
Nest[Append[#1, #1[[-1]] + 1 + 9 Boole[EvenQ@ #2]] & @@ {#, Length@ #} &, {1}, 55] (* Michael De Vlieger, Nov 23 2018 *)
nxt[{n_, a_}]:={n+1, If[OddQ[n], a+1, a+10]}; NestList[nxt, {1, 1}, 60][[All, 2]] (* or *) LinearRecurrence[{1, 1, -1}, {1, 2, 12}, 60] (* Harvey P. Dale, Jun 22 2021 *)
CROSSREFS
Sequence in context: A178362 A299961 A339139 * A032931 A072483 A081539
KEYWORD
nonn,easy
AUTHOR
Luis Farfan (ljfarfan(AT)gmail.com), Sep 01 2008
EXTENSIONS
Extended by R. J. Mathar, Sep 04 2008
New name from Michael De Vlieger, Nov 24 2018
STATUS
approved