|
|
A109681
|
|
"Sloping ternary numbers": write numbers in ternary under each other (right-justified), read diagonals in upward direction, convert to decimal.
|
|
10
|
|
|
0, 1, 5, 3, 4, 8, 6, 16, 11, 9, 10, 14, 12, 13, 17, 15, 25, 20, 18, 19, 23, 21, 22, 26, 51, 34, 29, 27, 28, 32, 30, 31, 35, 33, 43, 38, 36, 37, 41, 39, 40, 44, 42, 52, 47, 45, 46, 50, 48, 49, 53, 78, 61, 56, 54, 55, 59, 57, 58, 62, 60, 70, 65, 63, 64, 68, 66
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
All terms are distinct, but certain terms (see A109682) are missing.
For the terms 3^k-1 (all 2's in ternary), the diagonal is not started at the leading 2, but at the leading 1 of the following term. - Georg Fischer, Mar 13 2020
|
|
LINKS
|
|
|
EXAMPLE
|
number diagonal decimal
0 0 0
1 1 1
2 12 5
10 10 3
11 11 4
12 22 8
20 20 6
21 121 16
22 102 11
100 100 9
101 101 10
102 112 14
110 110 12
11. ... ...
1.
.
|
|
MAPLE
|
t:= (n, i)-> (d-> `if`(i=0, d, t(m, i-1)))(irem(n, 3, 'm')):
b:= (n, i)-> `if`(3^i>n, 0, t(n, i) +3*b(n+1, i+1)):
a:= n-> b(n, 0):
|
|
PROG
|
(Haskell)
a109681 n = a109681_list !! n
a109681_list = map (foldr (\d v -> 3 * v + d) 0) $ f a030341_tabf where
f vss = (g 0 vss) : f (tail vss)
g k (ws:wss) = if k < length ws then ws !! k : g (k + 1) wss else []
(Perl) Cf. link.
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,nice,easy,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Conjectured g.f. and recurrence removed by Georg Fischer, Mar 13 2020
|
|
STATUS
|
approved
|
|
|
|