cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A108018 a(n) = the number of primes representable as the sum of some subset of the set of first n primes.

Original entry on oeis.org

1, 3, 4, 5, 9, 12, 16, 19, 25, 31, 37, 43, 51, 59, 66, 75, 84, 95, 103, 115, 127, 137, 150, 162, 177, 191, 205, 218, 233, 250, 267, 282, 299, 319, 338, 359, 376, 399, 421, 440, 461, 481, 508, 531, 556, 578, 602, 629, 653, 683, 707, 737, 765, 793, 824, 853, 883
Offset: 1

Views

Author

Max Alekseyev, Sep 08 2006

Keywords

Comments

a(n) = length of n-th row in A256015; A066028(n) = A256015(n,a(n)). - Reinhard Zumkeller, Jun 01 2015

Crossrefs

Cf. A071810 (same count but with multiplicities).

Programs

  • Haskell
    import Data.List (subsequences, nub)
    a108018 = sum . map a010051' . nub . map sum .
              tail . subsequences . flip take a000040_list
    -- Reinhard Zumkeller, Dec 16 2013
  • Mathematica
    (* This program is not suitable to compute a large number of terms. *)
    a[n_] := a[n] = Select[Total /@ Subsets[Table[Prime[i], {i, 1, n}]], PrimeQ] // Union // Length;
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 25}] (* Jean-François Alcover, Mar 12 2019 *)

Extensions

More terms from Alois P. Heinz, Oct 24 2015

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.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 01 2015

Keywords

Comments

A066028(n) = T(n,A108018(n)).

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 .
		

Crossrefs

Cf. A010051, A000040, A108018 (row lengths), A066028 (right edge).

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)
Showing 1-2 of 2 results.