Find longest chain of prime numbers