|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Old name was "Start with 1; then repeatedly add 1, then add 10."
|
|
LINKS
|
|
|
FORMULA
|
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)
|
|
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
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
Luis Farfan (ljfarfan(AT)gmail.com), Sep 01 2008
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|