Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A127542
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A127542 Number of subsets of {1,2,3,...,n} whose sum is prime. +0
3
0, 2, 4, 7, 12, 22, 42, 76, 139, 267, 516, 999, 1951, 3824, 7486, 14681, 28797, 56191, 108921, 210746, 410016, 804971, 1591352, 3153835, 6249154, 12380967, 24553237, 48731373, 96622022, 191012244, 376293782, 739671592, 1454332766, 2867413428 (list; graph; listen)
OFFSET

1,2

LINKS

T. D. Noe, Table of n, a(n) for n=1..100

EXAMPLE

The subsets of {1,2,3} that sum to a prime are {1,2}, {2}, {3}, {2,3}. Thus a(3)=4.

MAPLE

with(combinat): a:=proc(n) local ct, pn, j:ct:=0: pn:=powerset(n): for j from 1 to 2^n do if isprime(add(pn[j][i], i=1..nops(pn[j]))) =true then ct:=ct+1 else ct:=ct fi: od: end: seq(a(n), n=1..18);

MATHEMATICA

g[n_] := Block[{p = Product[1 + z^i, {i, n}]}, Sum[Boole[PrimeQ[k]]*Coefficient[p, z, k], {k, 0, n*(n + 1)/2}]]; Array[g, 34] (*Chandler*)

CROSSREFS

Cf. A053632, A126024.

Sequence in context: A064492 A000072 A018179 this_sequence A023432 A072641 A135360

Adjacent sequences: A127539 A127540 A127541 this_sequence A127543 A127544 A127545

KEYWORD

nonn

AUTHOR

Emeric Deutsch (deutsch(AT)duke.poly.edu), Mar 03 2007

EXTENSIONS

Extended by Ray Chandler (rayjchandler(AT)sbcglobal.net), Mar 05 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified July 26 23:19 EDT 2008. Contains 142293 sequences.


AT&T Labs Research