OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
EXAMPLE
. n | a(n) let x denote A006895
. ----+------
. 1 | 1 = x(0)
. 2 | 2 = x(1)
. 3 | 3 = 2 + 1 = x(1) + x(2)
. 4 | 4 = 1 + 3 = x(2) + x(3)
. 5 | 9 = 3 + 6 = x(3) + x(4)
. 6 | 8 = 6 + 2 = x(4) + x(5)
. 7 | 16 = x(6)
. 8 | 27 = 2 + 16 + 9 = x(5) + x(6) + x(7)
. 9 | 32 = 9 + 23 = x(7) + x(8)
. 10 | 81 = 23 + 58 = x(8) + x(9)
. 11 | 64 = 58 + 6 = x(9) + x(10)
. 12 | 128 = x(11)
. 13 | 243 = 6 + 128 + 109 = x(10) + x(11) + x(12)
. 14 | 256 = 109 + 147 = x(12) + x(13)
. 15 | 512 = x(14)
. 16 | 729 = 147 + 512 + 70 = x(13) + x(14) + x(15) .
PROG
(Haskell)
a227928 n = a227928_list !! (n-1)
a227928_list = 1 : f 0 0 (tail a000079_list) (tail a000244_list) where
f x y us'@(u:us) vs'@(v:vs)
| x > 0 = u : f 0 (u - x + y) us vs'
| y > v - u = v : f (v + x - y) 0 us' vs
| otherwise = u : f 0 (u + y) us vs'
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Oct 09 2013
STATUS
approved