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.
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, 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, 4, 9, 10, 12, 13, 0, 14, 0, 1, 14, 15, 0, 1, 15, 16, 0, 2, 3, 14, 15, 17
Offset: 0
Examples
Irregular table T(n, k) begins: 0: [0] 1: [0, 1] 2: [0, 2] 3: [0, 1, 2, 3] 4: [0, 1, 3, 4] 5: [0, 5] 6: [0, 1, 5, 6] 7: [0, 1, 6, 7] 8: [0, 2, 3, 5, 6, 8] 9: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..8768 (rows for n = 0..3^5 flattened)
- Rémy Sigrist, Scatterplot of (n, T(n, k)) for n <= 3^6 on a hexagonal lattice
- Wikipedia, Balanced ternary
- Wikipedia, Hexaflake.
Programs
-
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) } row(n) = select(k -> ok(n-k, k), [0..n])
Formula
T(n, 0) = 0.
T(n, A352502(n)-1) = n.
Extensions
Index correction from Rémy Sigrist, Jan 18 2025
Comments