%I #13 Sep 19 2016 16:11:58
%S 7,13,29,67,89,151,191,277,433,701,859,947,1129,1429,1889,2557,2699,
%T 4003,4751,5779,8647,11173,12401,13367,14029,16111,18719,19501,22367,
%U 24977,27259,31627,33151,36313,36857,38501,39619,47279,49139,56951
%N Prime numbers that are 2 less than a prime-indexed odd triangular number or 1 more than a prime-indexed even triangular number.
%D David Wells, The Penguin Dictionary of Curious & Interesting Numbers. In the entry for 496 he remarks that 496 is the smallest counterexample to the conjecture that an even, prime-indexed triangular plus 1 equals a prime, since 497 is not prime.
%H Harvey P. Dale, <a href="/A096333/b096333.txt">Table of n, a(n) for n = 1..1000</a>
%F Given the numbers of A034953, triangular numbers with prime indices, subtract 2 from the odd numbers on the list and add 1 to the even numbers on the list, then remove from the list the composite numbers.
%e a(2) = 13 because 15 is the 5th triangular number and since it is odd and we take 2 away from it, it yields the prime 13.
%e a(3) = 29 because 28 is the 7th triangular number and since it is even and we add 1 to it, it yields the prime 29.
%e 497 is not on the list because although 496 is the 31st triangular number, but 496 + 1 = 7 * 71.
%e That sequence continues: 1771, 2279, 3161, 3487, 5149, 5357, 5993, 6439, 8129, 9451, 9731, ....
%t tri[n_] := n(n + 1)/2; tp = Table[ tri[ Prime[n]], {n, 2, 70}]; f[n_] := If[ OddQ[n], n - 2, n + 1]; Select[f /@ tp, PrimeQ[ # ] &] (* _Robert G. Wilson v_, Aug 12 2004 *)
%t Select[If[OddQ[#],#-2,#+1]&/@Table[(n(n+1))/2,{n,Prime[Range[ 100]]}], PrimeQ] (* _Harvey P. Dale_, Sep 19 2016 *)
%Y Cf. A034953.
%K nonn
%O 1,1
%A _Alonso del Arte_, Aug 02 2004
%E Edited and extended by _Robert G. Wilson v_, Aug 12 2004