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.

A302021 Numbers k such that k^2+1, (k+2)^2+1 and (k+6)^2+1 are prime.

Original entry on oeis.org

4, 14, 124, 204, 464, 1144, 1314, 1564, 1964, 2454, 3134, 4174, 4364, 5584, 5874, 6234, 7804, 8174, 8784, 9874, 9894, 10424, 12354, 12484, 12874, 14034, 14194, 15674, 16224, 18274, 18994, 21134, 21344, 22344, 22624, 23134, 23784, 23944, 24974, 25554, 26504, 26934, 27064, 27804, 29364
Offset: 1

Views

Author

Seiichi Manyama, Mar 31 2018

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..30000] | IsPrime(n^2+1) and IsPrime((n+2)^2+1) and IsPrime((n+6)^2+1)]; // Vincenzo Librandi, Apr 02 2018
    
  • Maple
    select(k->isprime(k^2+1) and isprime((k+2)^2+1) and isprime((k+6)^2+1),[$1..40000]); # Muniru A Asiru, Apr 02 2018
  • Mathematica
    Select[Range[1, 30000], PrimeQ[#^2 + 1] && PrimeQ[(# + 2)^2 + 1] && PrimeQ[(# + 6)^2 + 1] &] (* Vincenzo Librandi, Apr 02 2018 *)
  • PARI
    isok(k) = isprime(k^2+1) && isprime((k+2)^2+1) && isprime((k+6)^2+1); \\ Altug Alkan, Apr 02 2018
  • Python
    from sympy import isprime
    k, klist, A302021_list = 0, [isprime(i**2+1) for i in range(6)], []
    while len(A302021_list) < 10000:
        i = isprime((k+6)**2+1)
        if klist[0] and klist[2] and i:
            A302021_list.append(k)
        k += 1
        klist = klist[1:] + [i] # Chai Wah Wu, Apr 01 2018