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”).

Primes p such that p-1 is a triangular number and p-2 is a square.
4

%I #8 Jul 20 2024 19:20:54

%S 2,11,11027,16944049179227,

%T 94511138700672573788068264540372768937231403134027

%N Primes p such that p-1 is a triangular number and p-2 is a square.

%C Intersection of A129545 and A164055.

%C a(6) has 106 decimal digits: 12450353555...7512227.

%C a(7) has 381 decimal digits: 49394105798...1431227.

%C Roots of corresponding squares and triangular numbers: A226074 and A226073.

%t 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 *)

%o (Java)

%o import java.io.*;

%o import java.math.BigInteger;

%o public class A226072 {

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

%o try {

%o BufferedReader in = new BufferedReader(

%o new FileReader(new File("b164055.txt")));

%o String line;

%o while ((line = in.readLine()) != null) {

%o BigInteger b = new BigInteger(line.split(" ")[1]);

%o b = b.add(BigInteger.ONE);

%o if (b.isProbablePrime(80))

%o System.out.printf("%s, ", b.toString());

%o }

%o } catch (Exception e) { e.printStackTrace(); }

%o }

%o }

%Y Cf. A226069-A226074, A129545, A164055.

%K nonn

%O 1,1

%A _Alex Ratushnyak_, May 25 2013