cp's OEIS Frontend

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.

A109681 "Sloping ternary numbers": write numbers in ternary under each other (right-justified), read diagonals in upward direction, convert to decimal.

This page as a plain text file.
%I A109681 #28 Mar 14 2020 07:02:33
%S A109681 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,
%T A109681 34,29,27,28,32,30,31,35,33,43,38,36,37,41,39,40,44,42,52,47,45,46,50,
%U A109681 48,49,53,78,61,56,54,55,59,57,58,62,60,70,65,63,64,68,66
%N A109681 "Sloping ternary numbers": write numbers in ternary under each other (right-justified), read diagonals in upward direction, convert to decimal.
%C A109681 All terms are distinct, but certain terms (see A109682) are missing.
%C A109681 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
%H A109681 Reinhard Zumkeller, <a href="/A109681/b109681.txt">Table of n, a(n) for n = 0..10000</a>
%H A109681 Georg Fischer, <a href="/A109681/a109681.pl.txt">Perl program</a>
%e A109681 number diagonal decimal
%e A109681     0      0     0
%e A109681     1      1     1
%e A109681     2     12     5
%e A109681    10     10     3
%e A109681    11     11     4
%e A109681    12     22     8
%e A109681    20     20     6
%e A109681    21    121    16
%e A109681    22    102    11
%e A109681   100    100     9
%e A109681   101    101    10
%e A109681   102    112    14
%e A109681   110    110    12
%e A109681   11.    ...   ...
%e A109681   1.
%e A109681   .
%p A109681 t:= (n, i)-> (d-> `if`(i=0, d, t(m, i-1)))(irem(n, 3, 'm')):
%p A109681 b:= (n, i)-> `if`(3^i>n, 0, t(n,i) +3*b(n+1, i+1)):
%p A109681 a:= n-> b(n, 0):
%p A109681 seq(a(n), n=0..100);  # _Alois P. Heinz_, Mar 13 2020
%o A109681 (Haskell)
%o A109681 a109681 n = a109681_list !! n
%o A109681 a109681_list = map (foldr (\d v -> 3 * v + d) 0) $ f a030341_tabf where
%o A109681    f vss = (g 0 vss) : f (tail vss)
%o A109681    g k (ws:wss) = if k < length ws then ws !! k : g (k + 1) wss else []
%o A109681 -- _Reinhard Zumkeller_, Nov 19 2013
%o A109681 (Perl) Cf. link.
%Y A109681 Cf. A109682 (complement), A109683 (ternary version), A109684.
%Y A109681 Cf. A102370 (base 2), A325644 (base 4), A325645 (base 5), A325692 (base 6), A325693 (base 7), A325805 (base 8), A325829 (base 9), A103205 (base 10).
%Y A109681 Cf. A030341.
%K A109681 nonn,nice,easy,base
%O A109681 0,3
%A A109681 _Philippe Deléham_, Aug 08 2005
%E A109681 Conjectured g.f. and recurrence removed by _Georg Fischer_, Mar 13 2020