login
A318388
a(1) = 1, a(n) = -floor(e*a(n/2)) if n is even, a(n) = n - a(n-1) if n is odd.
1
1, -2, 5, 6, -1, -13, 20, -16, 25, 3, 8, 36, -23, -54, 69, 44, -27, -67, 86, -8, 29, -21, 44, -97, 122, 63, -36, 147, -118, -187, 218, -119, 152, 74, -39, 183, -146, -233, 272, 22, 19, -78, 121, 58, -13, -119, 166, 264, -215, -331, 382, -171, 224, 98, -43, -399, 456, 321, -262, 509, -448, -592, 655, 324, -259, -413
OFFSET
1,2
MATHEMATICA
Nest[Append[#1, If[EvenQ@ #2, -Floor[E #1[[#2/2]] ], #2 - #1[[-1]] ]] & @@ {#, Length@ # + 1} &, {1}, 65] (* Michael De Vlieger, Aug 25 2018 *)
PROG
(PARI) a(n)=if(n==1, 1, if(n%2==0, -floor(exp(1)*a(n/2)), n-a(n-1)));
CROSSREFS
Sequence in context: A200136 A134387 A222132 * A145058 A103130 A159987
KEYWORD
sign,look
AUTHOR
Altug Alkan, Aug 25 2018
STATUS
approved