login
A226072
Primes p such that p-1 is a triangular number and p-2 is a square.
4
2, 11, 11027, 16944049179227, 94511138700672573788068264540372768937231403134027
OFFSET
1,1
COMMENTS
Intersection of A129545 and A164055.
a(6) has 106 decimal digits: 12450353555...7512227.
a(7) has 381 decimal digits: 49394105798...1431227.
Roots of corresponding squares and triangular numbers: A226074 and A226073.
MATHEMATICA
Select[Prime[Range[1500]], OddQ[Sqrt[8(#-1)+1]]&&IntegerQ[Sqrt[#-2]]&] (* The program generates the first 3 terms of the sequence. *) (* Harvey P. Dale, Jul 20 2024 *)
PROG
(Java)
import java.io.*;
import java.math.BigInteger;
public class A226072 {
public static void main (String[] args) throws Exception {
try {
BufferedReader in = new BufferedReader(
new FileReader(new File("b164055.txt")));
String line;
while ((line = in.readLine()) != null) {
BigInteger b = new BigInteger(line.split(" ")[1]);
b = b.add(BigInteger.ONE);
if (b.isProbablePrime(80))
System.out.printf("%s, ", b.toString());
}
} catch (Exception e) { e.printStackTrace(); }
}
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, May 25 2013
STATUS
approved