Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #17 Oct 02 2023 20:15:10
%S 0,0,0,0,0,0,1,1,0,1,1,0,1,1,0,1,2,1,0,1,1,1,2,1,1,1,1,1,1,1,1,2,2,1,
%T 1,1,2,2,2,1,1,1,2,1,1,1,1,1,0,1,1,2,2,2,2,2,2,2,1,1,0,1,0,0,1,1,2,1,
%U 2,1,3,2,1,1,1,1,2,2,1,2,2,1,1,2,2,1,2,2,2,2,1,3,3,1,1,2,2,2,2,2
%N Number of decompositions of 2n into an unordered sum of two primes, one of the two primes less than sqrt(2n-2).
%H Robert Israel, <a href="/A240718/b240718.txt">Table of n, a(n) for n = 1..10000</a>
%e For n = 7, the a(7) = 1 solution is 2*7 = 3 + 11 = 7 + 7; one of these pairs, 3 + 11, contains a number less than sqrt(2*7 - 2).
%p P:= NULL: A[1]:= 0: nextp:= 2:
%p for n from 2 to 100 do
%p while nextp^2 < 2*n-2 do
%p P:= P, nextp;
%p nextp:= nextprime(nextp);
%p od;
%p A[n]:= numboccur(true, map(t -> isprime(2*n-t), [P]))
%p od:
%p seq(A[i],i=1..100); # _Robert Israel_, Apr 30 2019
%o (PARI)
%o a(n)=sum(i=2,primepi(floor(sqrt(2*n-2))),isprime(2*n-prime(i))) \\ _Lear Young_, Apr 11 2014
%Y Cf. A002375.
%K nonn
%O 1,17
%A _Lear Young_, Apr 11 2014