A256015 Triangle read by rows: n-th row contains all distinct primes which are representable as the sum of some subset of the set of first n primes.
2, 2, 3, 5, 2, 3, 5, 7, 2, 3, 5, 7, 17, 2, 3, 5, 7, 11, 13, 17, 19, 23, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 41, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67
Offset: 1
Examples
. 1: 2 | . 2: 2 3 | 5 . 3: 2 3 5 | 7 . 4: 2 3 5 7 | 17 . 5: 2 3 5 7 11 | 13 17 19 23 . 6: 2 3 5 7 11 13 | 17 19 23 29 31 41 . 7: 2 3 5 7 11 13 17 | 19 23 29 31 37 41 43 47 53 . 8: 2 3 5 7 11 13 17 19 | 23 29 31 37 41 43 47 53 59 61 67 .
Links
- Reinhard Zumkeller, Rows n = 1..25 of triangle, flattened
Programs
-
Haskell
import Data.List (subsequences, nub, sort) a256015 n k = a256015_tabf !! (n-1) !! (k-1) a256015_row n = a256015_tabf !! (n-1) a256015_tabf = map (sort . filter ((== 1) . a010051') . nub . map sum . tail . subsequences) (tail $ inits a000040_list)
Comments