OFFSET
1,4
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..6561
Robert Ferréol (MathCurve), Cantor's (ternary) set [in French]
MAPLE
a:= n-> -add((-1)^i*2^padic[ordp](i, 3), i=1..n-1):
seq(a(n), n=1..100); # Alois P. Heinz, Jan 05 2021
MATHEMATICA
a[n_] := Sum[(-1)^(i+1) * 2^IntegerExponent[i, 3], {i, 1, n-1}]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
PROG
(PARI) a(n)=-sum(i=1, n-1, (-1)^i*2^valuation(i, 3))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, May 03 2004
STATUS
approved