A233232 Primes p such that a Heronian triangle with a fixed side length of 5 contains p as another side length.
3, 5, 13, 29, 509, 1213, 4892189, 111790443613, 8585304626467575518951161931678989213, 196181078582773936644856635510156388051229, 18087581947968179558090719299773079036323829315869
Offset: 1
Keywords
Examples
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.
Programs
-
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 *)
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).
Comments