A199120 Number of partitions of n into terms of (1,4)-Ulam sequence, cf. A003666.
1, 1, 1, 1, 2, 3, 4, 5, 7, 8, 11, 13, 17, 20, 25, 30, 38, 44, 54, 63, 77, 90, 107, 124, 148, 171, 202, 231, 271, 310, 360, 412, 477, 542, 622, 705, 809, 915, 1042, 1175, 1335, 1501, 1699, 1905, 2148, 2403, 2702, 3018, 3383, 3768, 4212, 4682, 5223, 5794, 6445
Offset: 0
Keywords
Examples
The first terms of A003666 are 1, 4, 5, 6, 7, 8, 10, 16, 18, 19, ... a(7) = #{7, 6+1, 5+1+1, 4+1+1+1, 7x1} = 5; a(8) = #{8, 7+1, 6+1+1, 5+1+1+1, 4+4, 4+1+1+1+1, 8x1} = 7; a(9) = #{8+1, 7+1+1, 6+1+1+1, 5+4, 5+1+1+1+1, 4+4+1, 4+5x1, 9x1} = 8.
Links
- Eric Weisstein's World of Mathematics, Ulam Sequence
- Wikipedia, Ulam number
- Index entries for Ulam numbers
Programs
-
Haskell
a199120 = p a003666_list where p _ 0 = 1 p us'@(u:us) m | m < u = 0 | otherwise = p us' (m - u) + p us m