OFFSET
0,6
LINKS
Eric Weisstein's World of Mathematics, Ulam Sequence
Wikipedia, Ulam number
EXAMPLE
The first terms of A003666 are 1, 4, 5, 6, 7, 8, 10, 16, 18, 19, ...
a(12) = #{8+4, 7+5, 7+4+1, 6+5+1} = 4;
a(13) = #{8+5, 8+4+1, 7+6, 7+5+1} = 4;
a(14) = #{10+4, 8+6, 8+5+1, 7+6+1} = 4;
a(15) = #{10+5, 10+4+1, 8+7, 8+6+1, 6+5+4} = 5;
a(16) = #{16, 10+6, 10+5+1, 8+7+1, 7+5+4, 6+5+4+1} = 6.
PROG
(Haskell)
a199121 = p a003666_list where
p _ 0 = 1
p (u:us) m | m < u =
| otherwise = p us (m - u) + p us m
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Nov 03 2011
STATUS
approved