This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A353174 #23 Feb 19 2025 17:31:27 %S A353174 0,0,1,0,2,0,1,2,3,0,1,3,4,0,5,0,1,5,6,0,1,6,7,0,2,3,5,6,8,0,1,2,3,4, %T A353174 5,6,7,8,9,0,1,3,4,6,7,9,10,0,2,3,8,9,11,0,1,2,3,4,8,9,10,11,12,0,1,3, %U A353174 4,9,10,12,13,0,14,0,1,14,15,0,1,15,16,0,2,3,14,15,17 %N A353174 Irregular table T(n, k), n >= 0, k = 0..A352502(n)-1; the n-th row lists in ascending order the numbers k in 0..n such that k and n-k can be added without carries in balanced ternary. %C A353174 Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position. %C A353174 This sequence has connections with A295989; here we work with balanced ternary, there with binary. %C A353174 The set of points {(n, T(n, k))} has interesting fractal features, with voids in the form of Koch snowflakes (see illustration in Links section). %H A353174 Rémy Sigrist, <a href="/A353174/b353174.txt">Table of n, a(n) for n = 0..8768</a> (rows for n = 0..3^5 flattened) %H A353174 Rémy Sigrist, <a href="/A353174/a353174.png">Scatterplot of (n, T(n, k)) for n <= 3^6 on a hexagonal lattice</a> %H A353174 Wikipedia, <a href="https://en.wikipedia.org/wiki/Balanced_ternary">Balanced ternary</a> %H A353174 Wikipedia, <a href="https://en.wikipedia.org/wiki/N-flake#Hexaflake">Hexaflake</a>. %F A353174 T(n, 0) = 0. %F A353174 T(n, A352502(n)-1) = n. %e A353174 Irregular table T(n, k) begins: %e A353174 0: [0] %e A353174 1: [0, 1] %e A353174 2: [0, 2] %e A353174 3: [0, 1, 2, 3] %e A353174 4: [0, 1, 3, 4] %e A353174 5: [0, 5] %e A353174 6: [0, 1, 5, 6] %e A353174 7: [0, 1, 6, 7] %e A353174 8: [0, 2, 3, 5, 6, 8] %e A353174 9: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] %o A353174 (PARI) ok(u,v) = { while (u && v, my (uu=[0,+1,-1][1+u%3], vv=[0,+1,-1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); return (1) } %o A353174 row(n) = select(k -> ok(n-k, k), [0..n]) %Y A353174 Cf. A059095, A295989, A352502. %K A353174 nonn,base,tabf %O A353174 0,5 %A A353174 _Rémy Sigrist_, Apr 28 2022 %E A353174 Index correction from _Rémy Sigrist_, Jan 18 2025