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.

A217583 Numbers n^2+1 such that (n-1)^2+1 and (n+1)^2+1 are prime.

Original entry on oeis.org

10, 26, 226, 626, 3026, 15626, 42026, 148226, 216226, 403226, 416026, 511226, 1199026, 1311026, 1380626, 1550026, 1625626, 1729226, 1890626, 2449226, 2608226, 2805626, 2839226, 3861226, 4223026, 4347226, 4389026, 5784026, 6027026, 6426226, 7102226, 8037226
Offset: 1

Views

Author

Michel Lagneau, Oct 07 2012

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 500 do: x1:=n^2+1:x2:=(n+2)^2 + 1:if type(x1,prime)=true and type(x2,prime)=true then printf(`%d, `,(n+1)^2+1):else fi:od:
  • Mathematica
    Select[Partition[Range[3000]^2+1,3,1],AllTrue[{#[[1]],#[[3]]},PrimeQ]&][[All,2]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 03 2019 *)
  • PARI
    forstep(n=3,1e3,2,if(isprime(n^2+2*n+2) && isprime(n^2-2*n+2), print1(n^2+1", "))) \\ Charles R Greathouse IV, Oct 09 2012