login
Number of distinct sums p(i) + p(j) for 1<=i<=j<=n, p(k) = k-th prime.
6

%I #14 Mar 05 2023 21:29:49

%S 1,3,6,9,13,17,21,25,29,33,39,44,50,54,59,63,67,75,80,86,91,95,101,

%T 107,114,120,126,131,136,140,148,154,160,168,174,180,187,192,199,205,

%U 211,219,224,231,237,242,249,255,264,270,278,283,289,296,302,306,310,319

%N Number of distinct sums p(i) + p(j) for 1<=i<=j<=n, p(k) = k-th prime.

%H Zak Seidov, <a href="/A061781/b061781.txt">Table of n, a(n) for n = 1..10000</a>

%e Let P(n) = {2, 3, .., p_n} be the set of the first n primes. Construct S(n) = {p+q : p,q in P}. If every sum p+q were distinct, then |S(n)| would be n*(n+1)/2 = A000217(n). But in reality, for n >= 4, certain sums occur more than once. a(n) = |S(n)|. For example, P(6) = {2, 3, 5, 7, 11, 13} yields S(6) = {4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26}. Thus, a(6) = 17.

%t f[x_] := Prime[x]

%t Table[Length[Union[Flatten[Table[f[u]+f[w], {w, 1, m}, {u, 1, m}]]]], {m, 1, 75}]

%Y Cf. A000217, A061784.

%K nonn

%O 1,2

%A _Labos Elemer_, Jun 22 2001