OFFSET
0,1
FORMULA
a(0) = 5, a(n) = (-5)*a(n - 1) + 1 if a(n - 1) is odd, a(n) = a(n - 1)/2 otherwise.
EXAMPLE
5 is odd, so it's followed by (-5) * 5 + 1 = -25 + 1 = -24.
-14 is even, so it's followed by -14/2 = -7.
MATHEMATICA
NestList[If[EvenQ[#], #/2, -5# + 1] &, 5, 100]
PROG
(Magma) [n eq 1 select 5 else IsOdd(Self(n-1)) select -5*Self(n-1)+1 else Self(n-1) div 2: n in [1..80]]; // Vincenzo Librandi, Jun 11 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Alonso del Arte, May 26 2018
STATUS
approved