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.

A353136 Primes whose gaps to both neighbor primes are triangular numbers.

Original entry on oeis.org

53, 157, 173, 251, 257, 263, 337, 373, 547, 557, 563, 577, 587, 593, 607, 653, 733, 947, 977, 1039, 1103, 1123, 1181, 1187, 1223, 1367, 1627, 1747, 1753, 1907, 2017, 2063, 2287, 2417, 2677, 2719, 2897, 2903, 2963, 3307, 3313, 3517, 3547, 3637, 3733, 4013, 4211
Offset: 1

Views

Author

Alois P. Heinz, Apr 25 2022

Keywords

Examples

			Prime 251 is a term, the gap to the previous prime 241 is 10 and the gap to the next prime 257 is 6 and both gaps are triangular numbers.
		

Crossrefs

Programs

  • Maple
    t:= proc(n) option remember; issqr(8*n+1) end:
    q:= n-> isprime(n) and andmap(t, [n-prevprime(n), nextprime(n)-n]):
    select(q, [$3..5000])[];
  • Mathematica
    t[n_] := IntegerQ@Sqrt[8n+1];
    q[n_] := PrimeQ[n] && t[n-NextPrime[n, -1]] && t[NextPrime[n]-n];
    Select[Range[3, 5000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)