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.

A234531 Pentagonal numbers which are the arithmetic mean of two consecutive primes.

Original entry on oeis.org

12, 176, 376, 532, 590, 3015, 4510, 4676, 7315, 7526, 7957, 8855, 12650, 15555, 17120, 19437, 20126, 22265, 25676, 29330, 30175, 40755, 48510, 54626, 78547, 82017, 91390, 97410, 101270, 102051, 102835, 105205
Offset: 1

Views

Author

K. D. Bajpai, Dec 27 2013

Keywords

Comments

The n-th pentagonal number is (3*n^2 - n)/2 = n*(3*n - 1)/2.

Examples

			376 is in the sequence because 376 = 16*(3*16 - 1)/2 = (373 + 379)/2, the arithmetic mean of two consecutive primes.
532 is in the sequence because 532 = 19*(3*19 - 1)/2 = (523 + 541)/2, the arithmetic mean of two consecutive primes.
		

Crossrefs

Cf. A000326 (pentagonal numbers: n * (3 * n - 1 ) / 2).
Cf. A069495 (squares: arithmetic mean of two consecutive primes).
Cf. A234240 (cubes: arithmetic mean of three consecutive primes).

Programs

  • Maple
    KD := proc() local a,b,d,g;  a:= n*(3*n-1)/2; b:=prevprime(a); d:=nextprime(b); g:=(b+d)/2;  if a=g then RETURN (a);  fi; end: seq(KD(), n = 2..500);
  • Mathematica
    Select[PolygonalNumber[5,Range[300]],!PrimeQ[#]&&#==(NextPrime[ #]+ NextPrime[ #,-1])/2&] (* Harvey P. Dale, Dec 26 2022 *)
  • PARI
    lista(nn) = for (n=1, nn, pn = n*(3*n-1)/2; if (pn > 2, precp = precprime(pn-1); if (pn == (precp + nextprime(precp+1))/2, print1(pn, ", ")))) \\ Michel Marcus, Dec 30 2013

Extensions

Erroneous term 5 removed by Michel Marcus, Dec 30 2013