OFFSET
0,6
LINKS
Eric Weisstein's World of Mathematics, Ulam Sequence
Wikipedia, Ulam number
EXAMPLE
The first terms of A001857 are 2, 3, 5, 7, 8, 9, 13, 14, 18, 19, 24, ...
a(20) = #{18+2, 13+7, 13+5+2, 9+8+3, 8+7+5, 8+7+3+2} = 6;
a(21) = #{19+2, 18+3, 14+7, 14+5+2, 13+8, 13+5+3, 9+7+5, 9+7+3+2} = 8.
PROG
(Haskell)
a199123 = p a001857_list where
p _ 0 = 1
p (u:us) m | m < u = 0
| otherwise = p us (m - u) + p us m
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Nov 03 2011
STATUS
approved