%I #37 Oct 31 2024 06:48:37
%S 3,21,45,105,253,325,465,561,861,1081,1225,1485,1653,1953,3741,4005,
%T 4753,6441,7021,7381,8001,9045,10153,13041,15753,19701,20301,21945,
%U 23005,23653,24753,25425,28441,32385,35245,37401,38781,41041,43365,45753,46665,48205
%N Triangular numbers of the form 2p-1 where p is prime.
%C Indexes n in A000217(n): A217001.
%C The only triangular odd number with the form 2p+1 and p prime is 15=2*7+1?
%C The only triangular even numbers with the form 2p and p prime are {6,10}?
%C From _Daniel Starodubtsev_, Mar 13 2020: (Start)
%C Proof that 15 is the only triangular number of the form 2p + 1 where p is prime: we can express T(n)=n*(n+1)/2 and p=(T(n)-1)/2=(n*(n+1)/2-1)/2=(n+2)*(n-1)/4, which can be prime only if n+2=4 or n-1=4, from which we get the only possible value n=5 (T(n)=15).
%C It can also be easily seen that {6,10} are the only possible values of T(n) such that T(n)/2 is prime. (End)
%H T. D. Noe, <a href="/A217000/b217000.txt">Table of n, a(n) for n = 1..10000</a>
%e For A000217 = {0, 1, 3, 6, 10, 15, 21, 28,...}, A000217(6) = 21 = 2*(11)-1. As 11 is prime then A000217(6) is in the sequence. A000217(5) = 15 = 2*(8)-1. As 8 is not prime then A000217(5) is not in the sequence.
%p tn := unapply(n*(n+1)/2,n):
%p f := unapply((t+1)/2,t):
%p T := []: N := []: P := []:
%p for k from 0 to 5000 do
%p t:=tn(k):
%p p := f(k):
%p if p = floor(p) then
%p p = floor(p):
%p if isprime(p) then
%p T := [op(T), t]:
%p N := [op(N), k]:
%p P := [op(P), p]:
%p end if:
%p end if:
%p if nops(T) = 50 then
%p break:
%p end if:
%p end do:
%p T := T;
%t tri = 0; t = {}; Do[tri = tri + n; If[PrimeQ[(tri + 1)/2], AppendTo[t, tri]], {n, 500}]; t (* _T. D. Noe_, Sep 24 2012 *)
%Y Subsequence of A000217.
%Y Cf. A124174 (2*tr+1 is also a triangular number), A217001.
%K nonn
%O 1,1
%A _César Eliud Lozada_, Sep 22 2012