Observe that an is congruent to 3, 0, or 2 (mod 5) when n is congruent to 1, 2, or 0 (mod 3) respectively. Indeed, if n = 3k + m (where m is either 0, 1, or 2), then:
an
= [(3k+m) + (6k+2m)/3] + 7
= 5k + m + 7 + [2m/3]
= 5(k+1) + m + 2 if m = 0, 1 [which give 5(k+1) + 2, 5(k+1) + 3 respectively]
OR 5(k+1) + m + 3 if m = 2 [which gives 5(k+2)]
In fact, it's not hard to see that the sequence contains every number congruent to 2 or 3 (mod 5) except for 2, 3, and 7. To prove the sequence contains infinitely many primes, it suffices to show that there are infinitely many primes that are congruent to either 2 or 3 (mod 5), that is, not every non-5 prime is congruent to either 1 or 4 (mod 5). So suppose that there are only finitely many primes congruent to 2 (mod 5), and only finitely many congruent to 3 (mod 5). Call them p1, ..., pq, where p1 = 2. Consider the number:
5p2...pq+2
It's congruent to 2 (mod 5), so its prime factors cannot all be congruent to 1 or 4 (mod 5). It is co-prime to all the primes p2, ..., pq because these numbers are all greater than 2, and it is co-prime to 2 (i.e. it's odd) because p2, ..., pq are all odd. Therefore it must have a prime factor congruent to 2 or 3 (mod 5) that isn't in our list p1, ..., pq, contradicting our assumption that we could find a finite enumeration of the primes congruent to 2 or 3 (mod 5). So there are infinitely many such primes, and hence infinitely many primes in the sequence.