login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354449 a(n) is the number of pairs of primes (p,q) with p<q such that p+q = 2*n and that 2*n+p, 2*n+q, p*q-2*n and p*q+2*n are primes. 2
0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,15
LINKS
EXAMPLE
a(15) = 2 as there are two such pairs, (7,23) and (13,17): 2*15+7 = 37, 2*15+23 = 53, 7*23-2*15 = 131, 7*23+2*15 = 191, 2*15+13 = 43, 2*15+17 = 47, 13*17-2*15 = 191 and 13*17+2*15 = 251 are all prime.
MAPLE
f:= proc(n) local count, p, q;
p:= 2*n-1 ; count:= 0;
do
p:= prevprime(p);
if p < n then return count fi;
q:= 2*n-p;
if isprime(q) and isprime(2*n+q) and isprime(2*n+p) and isprime(p*q-2*n) and isprime(p*q+2*n) then count:=count+1 fi;
od
end proc:
f(1):= 0: f(2):= 0:
map(f, [$1..100]);
MATHEMATICA
a[n_] := Sum[If[AllTrue[{k, 2*n - k, 2*n + k, 4*n - k, k*(2 n - k) - 2*n, k*(2 n - k) + 2*n}, PrimeQ], 1, 0], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, May 31 2022 *)
PROG
(PARI) a(n) = sum(k=1, n, ispseudoprime(k) && ispseudoprime(2*n-k) && ispseudoprime(2*n+k) && ispseudoprime(4*n-k) && ispseudoprime(k*(2*n-k)-2*n) && ispseudoprime(k*(2*n-k)+2*n)) \\ adapted from Mathematica code, Felix Fröhlich, May 31 2022
CROSSREFS
Sequence in context: A349378 A331918 A089803 * A349436 A089811 A091888
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, May 31 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)