login
A097857
a(0) = 1, a(1) = 1, a(n) = floor((a(n-1)+a(n-2))/2) + 3 if a(n-2) is even, a(n) = floor((a(n-1)-a(n-2))/2) + 3 if a(n-2) is odd.
0
1, 1, 3, 4, 3, 6, 4, 8, 9, 11, 4, -1, 4, 5, 7, 4, 1, 5, 5, 3, 2, 2, 5, 6, 3, 7, 5, 2, 1, 4, 4, 7, 8, 3, 8, 5, 9, 5, 1, 1, 3, 4, 3, 6, 4, 8, 9, 11, 4, -1, 4, 5, 7, 4, 1, 5, 5, 3, 2, 2, 5, 6, 3, 7, 5, 2, 1, 4, 4, 7, 8, 3, 8, 5, 9, 5, 1, 1, 3, 4, 3, 6, 4, 8, 9, 11, 4, -1, 4, 5, 7, 4, 1, 5, 5, 3, 2, 2, 5, 6, 3, 7, 5, 2, 1, 4, 4, 7, 8, 3, 8, 5, 9, 5
OFFSET
0,3
COMMENTS
The series is periodic with period 38.
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
MATHEMATICA
nxt[{a_, b_}]:={b, If[EvenQ[a], Floor[(a+b)/2]+3, Floor[(b-a)/2]+3]}; NestList[nxt, {1, 1}, 120][[All, 1]] (* Harvey P. Dale, Mar 08 2022 *)
CROSSREFS
Sequence in context: A061112 A078809 A245218 * A176058 A110738 A175028
KEYWORD
sign,easy
AUTHOR
Gerald McGarvey, Aug 31 2004
EXTENSIONS
More terms from Emeric Deutsch, Nov 17 2004
STATUS
approved