A199121 Number of partitions of n into distinct terms of (1,4)-Ulam sequence, cf. A003666.
1, 1, 0, 0, 1, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 5, 6, 6, 7, 8, 7, 8, 10, 11, 11, 12, 14, 14, 15, 17, 18, 20, 21, 22, 24, 25, 27, 30, 31, 32, 35, 37, 39, 41, 44, 45, 48, 52, 53, 56, 60, 62, 66, 69, 72, 76, 81, 86, 89, 92, 96, 103, 109, 113, 117, 123, 127, 134
Offset: 0
Keywords
Examples
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.
Links
- Eric Weisstein's World of Mathematics, Ulam Sequence
- Wikipedia, Ulam number
- Index entries for Ulam numbers
Programs
-
Haskell
a199121 = p a003666_list where p _ 0 = 1 p (u:us) m | m < u = | otherwise = p us (m - u) + p us m