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.

A006895 Parenthesized one way gives the powers of 2: (1), (2), (1+3), ..., another way the powers of 3: (1), (2+1), (3+6), ....

Original entry on oeis.org

1, 2, 1, 3, 6, 2, 16, 9, 23, 58, 6, 128, 109, 147, 512, 70, 954, 1233, 815, 4096, 1650, 6542, 13141, 3243, 32768, 23038, 42498, 131072, 3577, 258567, 272874, 251414, 1048576, 294333, 1802819, 2980150, 1214154, 8388608, 4746145, 12031071, 31015650, 2538782
Offset: 0

Views

Author

N. J. A. Sloane, K. S. Brown [ kevin2003(AT)delphi.com ]

Keywords

Comments

Powers of 2 need 1 term or 2 terms parenthesized, whereas powers of 3 need 2 or 3 terms parenthesized, when 3 then the middle term is a power of 2. See A227928. - Reinhard Zumkeller, Oct 09 2013

Examples

			.  a(0)                                              =  _^0
.  a(1)                                              =  2^1
.  a(1) + a(2)            =    2 +   1               =  3^1
.  a(2) + a(3)            =    1 +   3        =    4 =  2^2
.  a(3) + a(4)            =    3 +   6        =    9 =  3^2
.  a(4) + a(5)            =    6 +   2        =    8 =  2^3
.  a(6)                                       =   16 =  2^4
.  a(5) + a(6) + a(7)     =    2 +  16 +   9  =   27 =  3^3
.  a(7) + a(8)            =    9 +  23        =   32 =  2^5
.  a(8) + a(9)            =   23 +  58        =   81 =  3^4
.  a(9) + a(10)           =   58 +   6        =   64 =  2^6
.  a(11)                                      =  128 =  2^7
.  a(10) + a(11) + a(12)  =    6 + 128 + 109  =  243 =  3^5
.  a(12) + a(13)          =  109 + 147        =  256 =  2^8
.  a(14)                                      =  512 =  2^9
.  a(13) + a(14) + a(15)  =  147 + 512 +  70  =  3^6 =  729 .
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006895 n = a006895_list !! n
    a006895_list = 1 : f 0 0 (tail a000079_list) (tail a000244_list) where
       f x y us'@(u:us) vs'@(v:vs)
         | x > 0     = (u - x) : f 0 (u - x + y) us vs'
         | y > v - u = (v - y) : f (v + x - y) 0 us' vs
         | otherwise =       u : f 0 (u + y) us vs'
    -- Reinhard Zumkeller, Oct 09 2013