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.

A138248 Prime numbers k such that 18*k - 1 and 18*k + 1 are twin primes.

Original entry on oeis.org

11, 29, 59, 71, 181, 199, 241, 251, 431, 491, 809, 991, 1051, 1109, 1151, 1231, 1249, 1289, 1319, 1459, 1571, 1931, 1949, 2099, 2411, 2729, 2909, 2939, 3301, 3461, 3499, 3511, 3881, 3889, 4201, 4231, 4651, 4679, 4721, 4889, 5011, 5081, 5209, 5639, 6299
Offset: 1

Views

Author

Keywords

Examples

			11*18 - 1 = 197 (prime), 11*18 + 1 = 199 (prime).
		

Crossrefs

Programs

  • Magma
    [n: n in [0..10000] |IsPrime(n) and IsPrime(18*n-1)and IsPrime(18*n+1)] // Vincenzo Librandi, Aug 03 2010
    
  • Mathematica
    a=18;Select[Prime[Range[250]],PrimeQ[a*#-1]&&PrimeQ[a*#+1] &]
  • Python
    from sympy import isprime, primerange
    def ok(p): return isprime(18*p-1) and isprime(18*p+1)
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(6299)) # Michael S. Branicky, Nov 29 2021