OFFSET
1,3
LINKS
Altug Alkan, Table of n, a(n) for n = 1..19682
Altug Alkan, A scatterplot of a(n) for n <= 3^10-1
Altug Alkan, A scatterplot of a(n) + A318265(n) for n <= 3^10-1
FORMULA
G.f. g(x) satisfies g(x) = -5*(1-x+x^2)*g(x^3) + (1+x+2*x^3-x^4)*x/(1-x^3)^2. - Robert Israel, Aug 24 2018
MAPLE
f:= proc(n) option remember;
if n mod 3 = 0 then -5*procname(n/3)
else n - procname(n-1)
fi
end proc:
f(1):= 1:
map(f, [$1..100]); # Robert Israel, Aug 24 2018
PROG
(PARI) a(n)=if(n==1, n, if(n%3==0, -5*a(n/3), n-a(n-1)));
CROSSREFS
KEYWORD
sign,look
AUTHOR
Altug Alkan, Aug 23 2018
STATUS
approved