login
Number of solutions to c(1)*prime(3)+...+c(n)*prime(n+2) = 2, where c(i) = +-1 for i>1, c(1) = 1.
3

%I #15 Jan 29 2024 10:52:21

%S 0,0,0,0,0,1,0,1,0,5,0,18,0,59,0,180,0,576,0,1993,0,6864,0,23804,0,

%T 83796,0,300913,0,1066508,0,3831226,0,13815422,0,50187328,0,183452325,

%U 0,674196751,0,2485443437,0,9232423194,0,34201130579,0,127197104929,0

%N Number of solutions to c(1)*prime(3)+...+c(n)*prime(n+2) = 2, where c(i) = +-1 for i>1, c(1) = 1.

%H Alois P. Heinz, <a href="/A022902/b022902.txt">Table of n, a(n) for n = 1..500</a>

%F a(n) = [x^3] Product_{k=4..n+2} (x^prime(k) + 1/x^prime(k)). - _Ilya Gutkovskiy_, Jan 28 2024

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

%t {f, s} = {3, 2}; 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}]

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

%t 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 5 solutions of using n=10 primes; _Peter J. C. Moses_, Oct 01 2013 *)

%K nonn

%O 1,10

%A _Clark Kimberling_

%E Corrected and extended by _Clark Kimberling_, Oct 01 2013

%E a(23)-a(49) from _Alois P. Heinz_, Aug 06 2015