A226072 Primes p such that p-1 is a triangular number and p-2 is a square.
2, 11, 11027, 16944049179227, 94511138700672573788068264540372768937231403134027
Offset: 1
Keywords
Programs
-
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(); } } }
-
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 *)
Comments