A234531 Pentagonal numbers which are the arithmetic mean of two consecutive primes.
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
Keywords
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.
Links
- K. D. Bajpai, Table of n, a(n) for n = 1..5535
Crossrefs
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
Comments