OFFSET
0,5
COMMENTS
This sequence has connections with a Takagi (or blancmange) curve.
Let t be the real function defined over [0..1] as follows:
- t(x) = 0 for x in [0..1/3],
- t(x) = x - 1/3 for x in ]1/3..2/3],
- t(x) = 1 - x for x in ]2/3..1].
Let g be the real function defined over [0..1] as follows:
- g(x) = Sum_{k >= 0} t(x * 3^k)/3^k.
The representation of n -> (n/3^k, a(n)/3^k) for n = 0..3^k converges to the representation of g over [0..1] as k tends to infinity.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..6560
Rémy Sigrist, Colored pinplot of the sequence for n = 0..3^7-1 (where the color denotes the contribution of the digits according to their position in the ternary expansion)
Wikipedia, Blancmange curve
FORMULA
EXAMPLE
MATHEMATICA
Accumulate[Table[Total[IntegerDigits[n, 3]/.(2->-1)], {n, 0, 80}]] (* Harvey P. Dale, Jun 23 2020 *)
PROG
(PARI) s = 0; for (n=0, 73, t = digits(n, 3); print1 (s+=sum(i=1, #t, if (t[i]==1, +1, t[i]==2, -1, 0)) ", "))
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Jul 13 2019
STATUS
approved