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.

A350496 Positive integers k such that if p is the largest prime less than k then k - p is prime.

This page as a plain text file.
%I A350496 #23 Jan 18 2022 06:51:04
%S A350496 5,7,9,10,13,15,16,19,21,22,25,26,28,31,33,34,36,39,40,43,45,46,49,50,
%T A350496 52,55,56,58,61,63,64,66,69,70,73,75,76,78,81,82,85,86,88,91,92,94,96,
%U A350496 99,100,103,105,106,109,111,112,115,116,118,120,124,126,129
%N A350496 Positive integers k such that if p is the largest prime less than k then k - p is prime.
%C A350496 a(n) is prime only when n is the greater of a twin prime pair (A006512). All other terms are composite.
%e A350496 9 is a term because the previous prime < 9 is 7, and 9 - 7 = 2, which is prime.
%t A350496 Select[Range[2, 130], PrimeQ[# - NextPrime[#, -1]] &] (* _Amiram Eldar_, Jan 02 2022 *)
%o A350496 (Python)
%o A350496 from sympy import isprime, prevprime
%o A350496 def ok(n): return n > 2 and isprime(n-prevprime(n))
%o A350496 print([k for k in range(249) if ok(k)]) # _Michael S. Branicky_, Jan 01 2022
%o A350496 (PARI) isok(k) = if (k>2, my(q=precprime(k-1)); isprime(k-q)); \\ _Michel Marcus_, Jan 02 2022
%Y A350496 Cf. A175090, A006512.
%K A350496 nonn
%O A350496 1,1
%A A350496 _Ryan Bresler_, Jan 01 2022