OFFSET
1,2
COMMENTS
A permutation of the positive integers with inverse A254650.
LINKS
EXAMPLE
. n |1|2|3|4|5|6|7|8|9|10 |11 |12 |13 |14
. a(n) |1|2|3|4|5|6|7|8|9| 10 | 11 | 15 | 19 | 14
--------+-+-+-+-+-+-+-+-+-+---------------+-------+-------+-------+--------
A007376 |1|2|3|4|5|6|7|8|9|1+0+1+1+1+2+1+3|1+4+1+5|1+6+1+7|1+8+1+9|2+0+2....
-
PROG
(Haskell)
a254649 n = a254649_list !! (n-1)
a254649_list = f a007376_list [0] where
f (x:xs) ys = g x xs where
g y zs'@(z:zs) | y `elem` ys = g (y + z) zs
| otherwise = y : f zs' (y:ys)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 04 2015
STATUS
approved