cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A285905 a(n) = A275768(A002110(n)).

This page as a plain text file.
%I A285905 #17 Feb 16 2025 08:33:44
%S A285905 0,0,5,26,124,852,7550,86125,1250924,23748764
%N A285905 a(n) = A275768(A002110(n)).
%C A285905 The number of ways to express primorial p_n# = A002110(n) as (prime(i) + prime(j))/2 when (prime(i) - prime(j))/2 also is prime.
%C A285905 Let p_n < q <= prime(pi(p_n#)), with pi(p_n#) = A000849(n). All such primes q are coprime to primorial p_n# since they are larger than the greatest prime factor of p_n#. One of the two primes counted by a(n) must be a prime q, the other a prime r = (2p_n# - q). Further, (r - q) must be prime to be counted by a(n). Therefore an efficient method of computing a(n) begins with generating the range of prime totatives prime(n + 1) <= q <= prime(pi(p_n#)) of primorial p_n#, the number of which is given by A048862(n).
%C A285905 a(n) < A048862(n) < A000849(n) for n > 2.
%H A285905 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Primorial.html">Primorial</a>
%H A285905 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Totative.html">Totative</a>
%e A285905 a(3) = 5 since there are 5 ways to express A002110(3) = 30 as (prime(i) + prime(j))/2 with (prime(i) - prime(j))/2 also prime:
%e A285905   (53 + 7)/2 = 30, (53 - 7)/2 = 46/2 = 23
%e A285905   (47 + 13)/2 = 30, (47 - 13)/2 = 34/2 = 17
%e A285905   (43 + 17)/2 = 30, (43 - 17)/2 = 26/2 = 13
%e A285905   (41 + 19)/2 = 30, (41 - 19)/2 = 22/2 = 11
%e A285905   (37 + 23)/2 = 30, (37 - 23)/2 = 14/2 = 7.
%t A285905 With[{j = 10^3}, Do[Module[{P = Times @@ Prime@ Range@ n, m}, m = PrimePi@ P; Print@ Total@ Reap[Do[Sow@ Count[Map[{2 P - #, #} &, Prime@ Range[Max[n, k], Min[k + j - 1, m]]], w_ /; And[PrimeQ@ First@ w, PrimeQ[(Subtract @@ w)/2]]], {k, 1, m, j}]][[-1, 1]]], {n, 9}]] (* or *)
%t A285905 Table[Function[P, Count[Map[{2 P - #, #} &, #], w_ /; And[PrimeQ@ First@ w, PrimeQ[(Subtract @@ w)/2]]] &@ Flatten@ Select[Prime@ Range[n + 1, PrimePi[P]], Times @@ Boole@ Map[PrimeQ, {#, P - #}] == 1 &]]@ Product[Prime@ i, {i, n}], {n, 9}] (* _Michael De Vlieger_, May 03 2017 *)
%t A285905 countOfPrimes = 0
%t A285905 countOfPrimes2 = 0
%t A285905 countOfPrimes3 = 0
%t A285905 Pn10 = 2*3*5*7*11*13*17*19*23*29
%t A285905 PnToUse = Pn10
%t A285905 distanceToCheck = PnToUse
%t A285905 For[i=0,i<distanceToCheck,i++,
%t A285905 If[PrimeQ[2*PnToUse-i],
%t A285905 countOfPrimes++
%t A285905 If[PrimeQ[(2*PnToUse-i)-PnToUse],
%t A285905 countOfPrimes2++
%t A285905 If[PrimeQ[i],
%t A285905 countOfPrimes3++]],]]
%t A285905 Print[countOfPrimes3]
%t A285905 (*code example for Pn(10) outputs a(10)=23748764*)
%t A285905 (* _Jamie Morken_, May 05 2017 *)
%Y A285905 Cf. A000849, A002110, A048862, A275768.
%K A285905 nonn,hard,more
%O A285905 1,3
%A A285905 _Michael De Vlieger_ and _Jamie Morken_, May 03 2017