login
Number of subsets of {n-1, n, n+1} that sum up to a prime.
4

%I #13 Jul 13 2013 12:03:23

%S 4,4,4,3,2,4,2,2,2,2,2,3,1,2,2,2,1,3,2,2,2,2,2,2,0,1,1,1,2,4,2,1,1,1,

%T 1,3,2,1,1,2,2,3,1,2,1,1,1,2,1,1,2,2,2,3,1,1,1,1,1,2,1,1,1,1,1,2,1,2,

%U 2,2,1,2,1,2,2,1,0,2,2,1,1,2,2,2,0,1,1,1,2,3,1,0,0,0,1,3,2,2,2,2,1,2,1,1,1

%N Number of subsets of {n-1, n, n+1} that sum up to a prime.

%C 0 <= a(n) <= 4; a(A066388(n)) = 4.

%C a(A221309(n)) = 0; a(A221310(n)) = 4. - _Reinhard Zumkeller_, Jan 10 2013

%H Reinhard Zumkeller, <a href="/A117499/b117499.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A010051(n-1) + A010051(n) + A010051(n+1) + A010051(2*n-1) + A010051(2*n) + A010051(2*n+1).

%e a(1) = #{2, 0+2=2, 1+2=3, 0+1+2=3} = 4;

%e a(2) = #{2, 3, 1+2=3, 2+3=5} = 4;

%e a(3) = #{2, 3, 2+3=5, 3+4=7} = 4;

%e a(4) = #{3, 5, 3+4=7} = 3;

%e a(5) = #{5, 5+6=11} = 2.

%t Table[Length[Select[{-1+n,n,1+n,-1+2 n,2 n,1+2 n,3 n},PrimeQ]],{n,105}]

%t ssp[{a_,b_,c_}]:=Count[Subsets[{a,b,c},3],_?(PrimeQ[Total[#]]&)]; ssp/@ Partition[ Range[0,110],3,1] (* _Harvey P. Dale_, Jan 29 2013 *)

%o (Haskell)

%o a117499 1 = sum $ map a010051 [1, 2, 0 + 1, 0 + 2, 1 + 2, 0 + 1 + 2]

%o a117499 n = sum $ map a010051 [n - 1, n, n + 1, 2 * n - 1, 2 * n + 1]

%o -- _Reinhard Zumkeller_, Jan 10 2013

%Y Cf. A010051.

%K nonn

%O 1,1

%A _Reinhard Zumkeller_, Mar 23 2006