OFFSET
1,3
LINKS
Altug Alkan, Table of n, a(n) for n = 1..10934
Altug Alkan, A scatterplot of a(n) for 4*3^8 <= n <= 5*3^8-1
MATHEMATICA
a[1]=1; a[n_] := a[n] = Switch[Mod[n, 3], 0, -5 a[n/3], 1, n + a[n-1], 2, n - a[n-1]]; Array[a, 68] (* Giovanni Resta, Sep 05 2018 *)
PROG
(PARI) a = vector(99); for(n=1, #a, print1 (a[n]=if(n<=1, 1, if (n%3==0, -5*a[n/3], if(n%3==1, n+a[n-1], n-a[n-1])))", "));
(PARI) a(n) = if(n==1, 1, if(n%3==0, -5*a(n/3), if(n%3==1, n+a(n-1), n-a(n-1))))
CROSSREFS
KEYWORD
sign,look
AUTHOR
Altug Alkan, Aug 28 2018
STATUS
approved