%I #6 Dec 10 2013 12:24:23
%S 3,5,13,29,509,1213,4892189,111790443613,
%T 8585304626467575518951161931678989213,
%U 196181078582773936644856635510156388051229,18087581947968179558090719299773079036323829315869
%N Primes p such that a Heronian triangle with a fixed side length of 5 contains p as another side length.
%C The triangle inequality requires that any integer triangle with a fixed side length of 5 can have remaining side lengths of (x, x+1),...,(x, x+4). The constraint that primitive Heronian triangles have only one even side will just permit (x, x+1) and (x, x+3). Also there is only one solution for the triple (5, x, x+3) namely (5, 5, 8). So a(n) = x or x+1 whenever the Heronian triangle has x or x+1 as a prime and n is the ordered occurrence of this prime. The ordered sequence of x is given by A233231 where x(n) = 10x(n-3)-x(n-6)+4, x(0)=2, x(1)=3, x(2)=5, x(3)=12, x(4)=29, x(5)=51 starting at x(1).
%F Primes of the form x(m) or x(m)+1 where x(m) is given by x(m) = 10x(m-3)-x(m-6)+4, x(0)=2, x(1)=3, x(2)=5, x(3)=12, x(4)=29, x(5)=51 starting at x(1).
%e a(4)=29 because the triangle with sides (5, 29, 30) is Heronian, 29 is prime and is the 4th occurrence of such a prime.
%t seq[n_] := seq[n]=Which[n==0, 2, n==1, 3, n==2, 5, n==3, 12, n==4, 29, n==5, 51, True, 10seq[n-3]-seq[n-6]+4]; lst={}; Do[Which[PrimeQ[seq[m]], AppendTo[lst, seq[m]], PrimeQ[seq[m]+1], AppendTo[lst, seq[m]+1], True, Null], {m, 1, 400}]; lst
%t t = LinearRecurrence[{1, 0, 10, -10, 0, -1, 1}, {2, 3, 5, 12, 29, 51, 122}, 400]; Select[Union[t, t + 1], PrimeQ[#] &] (* _T. D. Noe_, Dec 09 2013 *)
%Y Cf. A072221, A230666, A233231.
%K nonn
%O 1,1
%A _Frank M Jackson_, Dec 06 2013