A199017 Number of partitions of n into distinct terms of (1,2)-Ulam sequence, cf. A002858.
1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 14, 16, 16, 17, 19, 20, 22, 23, 25, 26, 27, 29, 30, 31, 34, 35, 38, 40, 41, 45, 45, 48, 51, 52, 57, 60, 62, 66, 68, 71, 75, 78, 83, 86, 93, 97, 100, 107, 109, 115, 120, 124, 132, 138
Offset: 0
Keywords
Examples
The first terms of A002858 are 1, 2, 3, 4, 6, 8, 11, 13, 16, 18, ... a(10) = #{8+2, 6+4, 6+3+1, 4+3+2+1} = 4; a(11) = #{11, 8+3, 8+2+1, 6+4+1, 6+3+2} = 5; a(12) = #{11+1, 8+4, 8+3+1, 6+4+2, 6+3+2+1} = 5.
Links
- Eric Weisstein's World of Mathematics, Ulam Sequence
- Wikipedia, Ulam number
- Index entries for Ulam numbers
Programs
-
Haskell
a199017 = p a002858_list where p _ 0 = 1 p (u:us) m | m < u = 0 | otherwise = p us (m - u) + p us m