|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|