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)).

Original entry on oeis.org

0, 0, 5, 26, 124, 852, 7550, 86125, 1250924, 23748764
Offset: 1

Views

Author

Michael De Vlieger and Jamie Morken, May 03 2017

Keywords

Comments

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.
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).
a(n) < A048862(n) < A000849(n) for n > 2.

Examples

			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:
  (53 + 7)/2 = 30, (53 - 7)/2 = 46/2 = 23
  (47 + 13)/2 = 30, (47 - 13)/2 = 34/2 = 17
  (43 + 17)/2 = 30, (43 - 17)/2 = 26/2 = 13
  (41 + 19)/2 = 30, (41 - 19)/2 = 22/2 = 11
  (37 + 23)/2 = 30, (37 - 23)/2 = 14/2 = 7.
		

Crossrefs

Programs

  • Mathematica
    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 *)
    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 *)
    countOfPrimes = 0
    countOfPrimes2 = 0
    countOfPrimes3 = 0
    Pn10 = 2*3*5*7*11*13*17*19*23*29
    PnToUse = Pn10
    distanceToCheck = PnToUse
    For[i=0,iJamie Morken, May 05 2017 *)