As in my 5 Dec 96 mail (Thanks Rich!), let d(n) be the alternating sum of the nonzero digits of the balanced ternary representation of n. E.g., d(-69) -> -1,0,1,1 -> -1-1+1 = -1. Then d is an odd function, and mod 3 is a squarefree (stutter-free) sequence. For n>=0, 0 1 2 1 0 1 2 0 2 1 0 2 0 1 2 1 0 1 2 0 1 0 2 1 2 0 2 1 0 2 0 1 0 2 1 2 0 1 2 1 0 1 2 0 2 1 0 2 0 1 2 1 0 1 2 0 1 0 2 0 1 2 1 0 2 1 2 0 2 1 0 1 2 0 1 0 2 . . .. Claim: the series of increments (-)^k exp(2 i pi d(k)/3) from k = -(3^n+1)/2 to (3^n-1)/2 draws a self-avoiding polygonal approximation to a curve which sweeps out the triangular Sierpinski "sponge" (or "gasket"). (Try it!) (Spongebob Trianglepants?) For k>=0, it draws a diagonal chain of consecutively larger ones (= the right half of an infinitely large one). There's a lot of interesting math here. I believe n (3 - 1) t ---------- 2 2 i pi d(k) ==== ----------- \ k 3 > (- 1) e / ==== n 3 + 1 k = - ------ 2 f(t) := limit ----------------------------------- n -> oo n 2 is a continuous map of [0,1] onto the closure of the Sierpinski triangle with the unit interval of the real axis as base. This gives us explicit valuations of f where t has a simple ternary expansion, e.g., the rationals. (f(.012101202..._3) = ?) Other claims: n 3 - 1 ------ 2 2 i pi d(k) ==== ----------- \ k 3 > k (- 1) e / ==== n 3 + 1 k = - ------ i sqrt(3) 2 - --------- = limit -------------------------------------, 6 n -> oo n n 2 3 n 3 - 1 ------ 2 2 i pi d(k) ==== ----------- \ 2 k 3 > k (- 1) e / ==== n 3 + 1 k = - ------ 1 2 - = limit --------------------------------------, 8 n -> oo 2 n n 3 2 n 3 - 1 ------ 2 2 i pi d(k) ==== ----------- \ 3 k 3 > k (- 1) e / ==== n 3 + 1 k = - ------ 7 i sqrt 3 2 - ---------- = limit --------------------------------------, ... 432 n -> oo 3 n n 3 2 --rwg PS, Weisstein gives (Thue-Morse sequence) the base 3 squarefree string 0 2 1 0 1 2 0 2 1 2 0 1 0 2 1 0 1 2 0 1 0 2 1 2 0 2 1 0 1 2 0 2 1 2 0 1 0 ... based on renaming the base 4 digits of twice the parity constant. Simpler: Parity(n+1) - Parity(n), where Parity(n) is the usual sum mod 2 of the binary digits of n. (Add 2 mod 3 for the exact match.)