OFFSET
1,1
COMMENTS
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).
FORMULA
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).
EXAMPLE
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.
MATHEMATICA
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 = 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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Dec 06 2013
STATUS
approved