login
A050821
Even numbers in the sequence generated by a(n)=|a(n-1)+2a(n-2)-n| where a(0)=a(1)=1.
1
0, 2, 0, 6, 0, 2, 8, 6, 8, 10, 10, 8, 14, 0, 0, 26, 4, 18, 8, 14, 18, 20, 20, 18, 28, 14, 12, 26, 44, 14, 26, 24, 38, 16, 10, 32, 22, 32, 64, 10, 36, 38, 22, 36, 64, 10, 24, 14, 6, 24, 38, 44, 74, 28, 36, 50, 92, 14, 52, 50, 46, 56, 72, 38, 24, 106, 6, 68, 30, 0, 80, 58, 42, 20, 4
OFFSET
1,2
MATHEMATICA
nxt[{n_, a_, b_}]:={n+1, b, Abs[b+2a-n-1]}; Select[NestList[nxt, {1, 1, 1}, 200][[All, 2]], EvenQ] (* Harvey P. Dale, Aug 25 2022 *)
CROSSREFS
Cf. A005210.
Equals 2*A039727(n).
Sequence in context: A332400 A355143 A274878 * A076257 A274881 A303638
KEYWORD
nonn,easy
EXTENSIONS
More terms from James A. Sellers
Definition clarified by Harvey P. Dale, Aug 25 2022
STATUS
approved