login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A022900 Number of solutions to c(1)*prime(3) + ... + c(n)*prime(n+2) = 0, where c(i) = +-1 for i>1, c(1) = 1. 3
0, 0, 0, 1, 0, 1, 0, 1, 0, 8, 0, 22, 0, 42, 0, 147, 0, 663, 0, 1803, 0, 7410, 0, 22463, 0, 87397, 0, 291211, 0, 1091736, 0, 3896012, 0, 13992225, 0, 49681944, 0, 184771042, 0, 677854904, 0, 2495656379, 0, 9260633829, 0, 34281074654, 0, 127420198855, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,10

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..500

EXAMPLE

a(8) counts the unique solution {5, -7, 11, -13, 17, -19, -23, 29}.

MATHEMATICA

{f, s} = {3, 0}; Table[t = Map[Prime[# + f - 1] &, Range[2, z]]; Count[Map[Apply[Plus, #] &, Map[t # &, Tuples[{-1, 1}, Length[t]]]], s - Prime[f]], {z, 22}]

(* A022900, a(n) = number of solutions of "sum = s" using Prime(f) to Prime(f+n-1) *)

n = 8; t = Map[Prime[# + f - 1] &, Range[n]]; Map[#[[2]] &, Select[Map[{Apply[Plus, #], #} &, Map[t # &, Map[Prepend[#, 1] &, Tuples[{-1, 1}, Length[t] - 1]]]], #[[1]] == s &]]  (* the unique solution of using n=8 primes; Peter J. C. Moses, Oct 01 2013 *)

PROG

(PARI) A022900(n, rhs=0, firstprime=3)={rhs-=prime(firstprime); my(p=vector(n-1, i, prime(i+firstprime))); sum(i=1, 2^(n-1), sum(j=1, #p, (1-bittest(i, j-1)<<1)*p[j])==rhs)} \\ For illustrative purpose, too slow for n >> 20. - M. F. Hasler, Aug 08 2015

CROSSREFS

Cf. A022894 - A022904, A022920.

Cf. A261061 - A261063 and A261045 (r.h.s. = -1); A261057, A261059, A261060, A261045 (r.h.s. = -2).

Sequence in context: A214205 A278147 A250109 * A028652 A028636 A028620

Adjacent sequences:  A022897 A022898 A022899 * A022901 A022902 A022903

KEYWORD

nonn

AUTHOR

Clark Kimberling

EXTENSIONS

Corrected and extended by Clark Kimberling, Oct 01 2013

a(23)-a(49) from Alois P. Heinz, Aug 06 2015

Missing cross-references added by M. F. Hasler, Aug 08 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 26 18:29 EST 2020. Contains 332293 sequences. (Running on oeis4.)