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.

A354462 a(n) is the least number k such that there are exactly n pairs (p,q) of primes with p such that p+q = 2*k and that 2*k+p, 2*k+q, p*q-2*k and p*q+2*k are primes.

This page as a plain text file.
%I A354462 #26 Jun 02 2022 10:11:39
%S A354462 1,4,15,315,420,825,2310,3150,1785,8925,6090,6405,8610,24990,19305,
%T A354462 12705,14175,15015,18165,19635,24255,48510,63525,33915,48195,54285,
%U A354462 35490,50505,55650,69615,71610,80850,78540,103740,39270,157920,60060,65835,90090,147840,120120,183645
%N A354462 a(n) is the least number k such that there are exactly n pairs (p,q) of primes with p<q such that p+q = 2*k and that 2*k+p, 2*k+q, p*q-2*k and p*q+2*k are primes.
%C A354462 a(n) is the least solution to A354449(k) = n.
%e A354462 a(2) = 15 because for k = 15 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; and 15 is the least k that works.
%p A354462 f:= proc(n) local count,p,q;
%p A354462   p:= 2*n-1 ; count:= 0;
%p A354462   do
%p A354462     p:= prevprime(p);
%p A354462     if p < n then return count fi;
%p A354462     q:= 2*n-p;
%p A354462     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 A354462   od
%p A354462 end proc:
%p A354462 f(1):= 0: f(2):= 0:
%p A354462 V:= Array(0..12): count:= 0:
%p A354462 for n from 1 while count < 13 do
%p A354462   v:= f(n);
%p A354462   if v <= 12 and V[v] = 0 then
%p A354462   count:= count+1; V[v]:= n
%p A354462 fi
%p A354462 od:
%p A354462 convert(V,list);
%t A354462 f[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}]; seq[len_, max_] := Module[{s = Table[0, {len}], n = 1, c = 0, i}, While[c < len && n <= max, i = f[n] + 1; If[i<= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[13, 10^4] (* _Amiram Eldar_, May 31 2022 *)
%o A354462 (PARI) a354449(n) = my(x=2*n, i=0); forprime(q=1, x, forprime(p=1, q-1, if(p+q==x && ispseudoprime(x+p) && ispseudoprime(x+q) && ispseudoprime(p*q-x) && ispseudoprime(p*q+x), i++))); i
%o A354462 a(n) = for(k=1, oo, if(a354449(k)==n, return(k))) \\ _Felix Fröhlich_, May 31 2022
%o A354462 (PARI) upto(n) = {n*=2; v = vector(n\2); forprime(p = 3, n, forprime(q = 3, min(p, n-p), k2 = p+q; if(ispseudoprime(k2+p) && ispseudoprime(k2+q) && ispseudoprime(p*q-k2) && ispseudoprime(p*q+k2), v[k2\2]++ ) ) ); res = [0]; for(i = 1, #v, if(v[i]+1 > #res, res = concat(res, vector(v[i]+1-#res)) ); if(res[v[i]+1] == 0, res[v[i]+1] = i ) ); res } \\ _David A. Corneth_, Jun 01 2022
%Y A354462 Cf. A045917, A136244, A354449.
%K A354462 nonn
%O A354462 0,2
%A A354462 _J. M. Bergot_ and _Robert Israel_, May 31 2022
%E A354462 a(13)-a(32) from _Amiram Eldar_, May 31 2022
%E A354462 More terms from _David A. Corneth_, Jun 01 2022