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.

A227928 Powers of 2 or of 3 in order as occurring in the two ways of parenthesizing the terms in A006895.

This page as a plain text file.
%I A227928 #7 Oct 09 2013 16:34:10
%S A227928 1,2,3,4,9,8,16,27,32,81,64,128,243,256,512,729,1024,2187,2048,4096,
%T A227928 6561,8192,19683,16384,32768,59049,65536,131072,177147,262144,531441,
%U A227928 524288,1048576,1594323,2097152,4782969,4194304,8388608,14348907,16777216,43046721
%N A227928 Powers of 2 or of 3 in order as occurring in the two ways of parenthesizing the terms in A006895.
%C A227928 Permutation of A006899, a(n) = A006899(n+k) for some k in {-1,0,1}.
%H A227928 Reinhard Zumkeller, <a href="/A227928/b227928.txt">Table of n, a(n) for n = 1..1000</a>
%e A227928 .  n  |  a(n)                       let x denote A006895
%e A227928 . ----+------
%e A227928 .   1 |    1                     =  x(0)
%e A227928 .   2 |    2                     =  x(1)
%e A227928 .   3 |    3  =   2 +   1        =  x(1) + x(2)
%e A227928 .   4 |    4  =   1 +   3        =  x(2) + x(3)
%e A227928 .   5 |    9  =   3 +   6        =  x(3) + x(4)
%e A227928 .   6 |    8  =   6 +   2        =  x(4) + x(5)
%e A227928 .   7 |   16                     =  x(6)
%e A227928 .   8 |   27  =   2 +  16 +   9  =  x(5) + x(6) + x(7)
%e A227928 .   9 |   32  =   9 +  23        =  x(7) + x(8)
%e A227928 .  10 |   81  =  23 +  58        =  x(8) + x(9)
%e A227928 .  11 |   64  =  58 +   6        =  x(9) + x(10)
%e A227928 .  12 |  128                     =  x(11)
%e A227928 .  13 |  243  =   6 + 128 + 109  =  x(10) + x(11) + x(12)
%e A227928 .  14 |  256  = 109 + 147        =  x(12) + x(13)
%e A227928 .  15 |  512                     =  x(14)
%e A227928 .  16 |  729  = 147 + 512 +  70  =  x(13) + x(14) + x(15) .
%o A227928 (Haskell)
%o A227928 a227928 n = a227928_list !! (n-1)
%o A227928 a227928_list = 1 : f 0 0 (tail a000079_list) (tail a000244_list) where
%o A227928    f x y us'@(u:us) vs'@(v:vs)
%o A227928      | x > 0     = u : f 0 (u - x + y) us vs'
%o A227928      | y > v - u = v : f (v + x - y) 0 us' vs
%o A227928      | otherwise = u : f 0 (u + y) us vs'
%K A227928 nonn
%O A227928 1,2
%A A227928 _Reinhard Zumkeller_, Oct 09 2013