OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MAPLE
A351466 := proc(n)
option remember ;
local a;
if n <= 2 then
n;
else
a := procname(n-1)+procname(n-3) ;
if type(a, 'even') then
a/2 ;
else
a ;
end if;
end if;
end proc:
seq(A351466(n), n=1..100) ; # R. J. Mathar, Jul 05 2022
MATHEMATICA
a[1] = a[3] = 1; a[2] = 2; a[n_] := a[n] = If[EvenQ[(s = a[n - 1] + a[n - 3])], s/2, s]; Array[a, 70] (* Amiram Eldar, Feb 27 2022 *)
nxt[{a_, b_, c_}]:={b, c, If[EvenQ[(a+c)], (a+c)/2, a+c]}; NestList[nxt, {1, 2, 1}, 70][[;; , 1]] (* Harvey P. Dale, Feb 25 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jack Braxton, Feb 11 2022
EXTENSIONS
Definition clarified by Harvey P. Dale, Feb 25 2023
STATUS
approved