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.

A236431 Numbers n such that both prime(n)+n and prime(n)-n give a triangular number.

Original entry on oeis.org

1, 513, 213796
Offset: 1

Views

Author

Michel Marcus, Jan 25 2014

Keywords

Comments

Intersection of A115882 and A115883.
The corresponding primes are 2, 3673, 2955107.
No more terms up to 10^12. - Giovanni Resta, Jan 26 2014

Examples

			prime(1) is 2, and both 2+1=3 and 2-1=1 are triangular.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[214000],AllTrue[{Sqrt[8(Prime[#]-#)+1],Sqrt[8(Prime[#]+#)+ 1]},OddQ]&] (* Harvey P. Dale, Jul 22 2022 *)
  • PARI
    lista(nn) = {p = primes(nn); for (n=1, #p, pn = p[n]; if (ispolygonal(pn - n, 3) && ispolygonal(pn + n, 3), print1(n, ", ")););}