login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Triangular numbers t such that t - 4, t - 2, t + 2, t + 4 are four primes.
1

%I #23 Sep 08 2022 08:46:05

%S 15,105,1485,18915,666435,2143485,4174605,10059855,10440165,28196295,

%T 95295915,124591005,155064855,171023265,206258205,298400235,311737965,

%U 347701635,389470095,459332895,460424685,498948255,526517475,537575655,615496155,645500415,885763005,963144105

%N Triangular numbers t such that t - 4, t - 2, t + 2, t + 4 are four primes.

%C Subsequence of A129752.

%C Proper subsequence of A226196. - _Alex Ratushnyak_, May 30 2013

%t Select[Accumulate[Range[0, 70]], Union[PrimeQ[{# - 4, # - 2, # + 2, # + 4}]] == {True} &] (* _Alonso del Arte_, May 27 2013 *)

%o (Java)

%o import java.math.BigInteger;

%o public class A226109 {

%o public static void main (String[] args) {

%o for (long n = 1; n < (1L << 31); n++) {

%o long p2 = n * (n + 1)/2 + 2, m2 = p2 - 4;

%o BigInteger b = BigInteger.valueOf(p2);

%o if (!b.isProbablePrime(80)) continue;

%o b = BigInteger.valueOf(m2);

%o if (!b.isProbablePrime(80)) continue;

%o b = BigInteger.valueOf(p2 + 2);

%o if (!b.isProbablePrime(80)) continue;

%o b = BigInteger.valueOf(m2 - 2);

%o if (!b.isProbablePrime(80)) continue;

%o System.out.printf("%d, ", p2 - 2);

%o }

%o }

%o }

%o (Magma) A000217:=func<m | m*(m+1) div 2>; [A000217(t): t in [0..10^5] | forall{A000217(t)+i: i in [-4,-2,2,4] | IsPrime(A000217(t)+i)}]; // _Bruno Berselli_, May 27 2013

%Y Cf. A000217, A024675, A129752, A130178, A226196.

%K nonn

%O 1,1

%A _Alex Ratushnyak_, May 26 2013