login
Integers k such that A002110(k) is the average of two consecutive primes.
0

%I #38 May 19 2024 02:14:17

%S 2,3,5,8,38,40,64,73,89,236,480,486

%N Integers k such that A002110(k) is the average of two consecutive primes.

%C In other words, the primorial numbers that are considered are those of the form (p + q)/2 where p and q are consecutive primes. Note that the initial values of (p - q)/2 are 1, 1, 1, 23, 239, 191, 331, 373, 1021.

%C A088256 is a subsequence of these primorials, which in turn are a subsequence of A024675.

%C Numbers k such that A038711(k) = A060270(k). - _Amiram Eldar_, May 19 2024

%H <a href="/index/Pri#primorial_numbers">Index entries for sequences related to primorial numbers</a>.

%e 5 is a term because 2*3*5*7*11 = 2310 = (2309 + 2311)/2.

%e 8 is a term because 2*3*5*7*11*13*17*19 = 9699690 = (9699667 + 9699713)/2.

%p P:= 2: count:= 0:

%p for n from 2 to 500 do

%p P:= P*ithprime(n);

%p # first try d=1

%p if isprime(P+1) then

%p good:= isprime(P-1);

%p elif isprime(P-1) then good:= false

%p else

%p for d from ithprime(n+1) by 2 do

%p if igcd(d,P) > 1 then next fi;

%p if isprime(P+d) then

%p good:= isprime(P-d); break

%p elif isprime(P-d) then

%p good:= false; break

%p fi

%p od;

%p fi;

%p if good then

%p count:= count+1;

%p A[count]:= n;

%p fi

%p od:

%p seq(A[i],i=1..count); # _Robert Israel_, Aug 29 2016

%t prim[n_] := Times @@ Prime[Range[n]]; Select[Range[2, 100], Total[NextPrime[(p = prim[#]), {-1, 1}]] == 2*p &] (* _Amiram Eldar_, May 19 2024 *)

%o (PARI) a002110(n) = prod(k=1, n, prime(k));

%o for(n=2, 1e3, if((nextprime(a002110(n)) - a002110(n)) == (a002110(n) - precprime(a002110(n))), print1(n, ", ")))

%Y Cf. A002110, A024675, A038711, A060270, A088256.

%K nonn,more

%O 1,1

%A _Altug Alkan_, Mar 21 2016