A356864 a(n) is the number of primes p < n such that 2*n-p and p*(2*n-p)+2*n are also prime.
0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 0, 3, 0, 2, 3, 0, 3, 4, 1, 1, 2, 1, 2, 3, 0, 0, 3, 1, 3, 1, 0, 5, 3, 0, 2, 1, 0, 3, 6, 0, 1, 2, 1, 1, 3, 0, 2, 2, 0, 2, 1, 1, 4, 6, 0, 2, 11, 0, 3, 3, 0, 2, 2, 0, 0, 2, 0, 4, 4, 0, 1, 3, 1, 5, 3, 0, 2, 8, 0, 2, 3, 0, 1, 5, 0, 0, 6, 1, 4, 5, 0, 3, 4, 0, 3, 1
Offset: 1
Keywords
Examples
a(11) = 2 because 3, 22-3 = 19 and 3*19+22 = 79, and 5, 22-5 = 17 and 5*17+22 = 107 are all prime.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A061357.
Programs
-
Maple
f:= proc(m) local p,q,t; p:= 1: t:= 0: do p:= nextprime(p); q:= n-p; if q <= p then return t fi; if isprime(q) and isprime(p*q+m) then t:= t+1 fi; od end proc: map(f, 2*[$1..100]);
-
Mathematica
a[n_] := Count[Range[n - 1], ?(AllTrue[{#, 2*n - #, #*(2*n - #) + 2*n}, PrimeQ] &)]; Array[a, 100] (* _Amiram Eldar, Sep 01 2022 *)
Comments