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.

A354449 a(n) is the number of pairs of primes (p,q) with p 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.

This page as a plain text file.
%I A354449 #29 Jun 07 2022 13:00:58
%S A354449 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,
%T A354449 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,
%U A354449 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
%N 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.
%H A354449 Robert Israel, <a href="/A354449/b354449.txt">Table of n, a(n) for n = 1..10000</a>
%e A354449 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.
%p A354449 f:= proc(n) local count,p,q;
%p A354449   p:= 2*n-1 ; count:= 0;
%p A354449   do
%p A354449     p:= prevprime(p);
%p A354449     if p < n then return count fi;
%p A354449     q:= 2*n-p;
%p A354449     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;
%p A354449   od
%p A354449 end proc:
%p A354449 f(1):= 0: f(2):= 0:
%p A354449 map(f, [$1..100]);
%t A354449 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 *)
%o A354449 (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
%Y A354449 Cf. A045917, A354462.
%K A354449 nonn
%O A354449 1,15
%A A354449 _J. M. Bergot_ and _Robert Israel_, May 31 2022