OFFSET
1,4
LINKS
FORMULA
a(n) = sum{j=1..n, A081134(j)}.
EXAMPLE
First seven terms of A081134 are 0,1,0,1,2,3,2, so a(7) = 9.
MATHEMATICA
Accumulate[Flatten[Table[Join[Range[0, 3^n], Range[3^n-1, 1, -1]], {n, 0, 4}]]] (* Harvey P. Dale, Sep 21 2016 *)
PROG
(PARI) {s=0; for(n=1, 62, p=3^floor(0.1^25+log(n)/log(3)); print1(s=s+min(n-p, 3*p-n), ", "))}
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Klaus Brockhaus, Mar 17 2003
STATUS
approved