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!)
A022903 Number of solutions to c(1)*prime(4) + ... + c(n)*prime(n+3) = 0, where c(i) = +-1 for i>1, c(1) = 1. 6
0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 9, 0, 61, 0, 131, 0, 486, 0, 2029, 0, 5890, 0, 21127, 0, 75979, 0, 273657, 0, 1032161, 0, 3694665, 0, 12989200, 0, 48409376, 0, 174262116, 0, 642786775, 0, 2402713235, 0, 8918299277, 0, 32868170524, 0, 123143998606, 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

FORMULA

a(2n-1) = 0 for all n >= 1 because an odd number of odd terms on the l.h.s. cannot sum to zero. - M. F. Hasler, Aug 08 2015

EXAMPLE

a(10) counts these 6 solutions: {7, -11, -13, -17, -19, -23, 29, -31, 37, 41}, {7, 11, -13, 17, 19, -23, 29, 31, -37, -41}, {7, 11, -13, 17, 19, 23, -29, -31, 37, -41}, {7, 11, 13, -17, -19, 23, 29, 31, -37, -41}, {7, 11, 13, -17, 19, 23, -29, -31, -37, 41}, {7, 11, 13, 17, -19, -23, 29, -31, 37, -41}.

MAPLE

A022903 := proc(n)

    local a, b, cs, cslen ;

    a := 0 ;

    for b from 0 to 2^(n-1)-1 do

        cs := convert(b, base, 2) ;

        cslen := nops(cs) ;

        if cslen < n-1 then

            cs := [op(cs), seq(0, i=1..n-1-cslen)] ;

        end if;

        if ithprime(4)+add( (-1+2*op(i-4, cs)) *ithprime(i), i=5..n+3) = 0 then

            a := a+1 ;

        end if;

    end do:

    a ;

end proc:

for n from 1 do

    print(n, A022903(n)) ;

end do: # R. J. Mathar, Aug 06 2015

MATHEMATICA

{f, s} = {4, 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}]

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

n = 10; 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 6 solutions of using n=10 primes; Peter J. C. Moses, Oct 01 2013 *)

PROG

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

CROSSREFS

Cf. A022894, A022895, ..., A022904, A083309, A022920 (variants with r.h.s. in {0, 1 or 2}, starting with prime(1), prime(2), prime(3) or prime(4)); A261061 - A261063 and A261045 (r.h.s. = -1); A261057, A261059, A261060, A261045(r.h.s. = -2).

Sequence in context: A114530 A085673 A117492 * A331239 A324008 A248681

Adjacent sequences:  A022900 A022901 A022902 * A022904 A022905 A022906

KEYWORD

nonn

AUTHOR

Clark Kimberling

EXTENSIONS

a(23)-a(49) from Alois P. Heinz, Aug 06 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 09:33 EST 2020. Contains 332277 sequences. (Running on oeis4.)