Of these eight, all are of the form 4k+1, and all others are primes except 65 (= 5*13) and 177 (= 3*59). Conjecture: There are no more terms after the eight one, 193. (Checked up to the 400000th term of A166040, i.e. up to A005408(400000)=800001.)
Table of n, a(n) for n=1..8.
(MIT Scheme with macro MATCHING-POS by AK):
(define (A166088 n) (A005408 (index_for_a166088 n)))
(define index_for_a166088 (MATCHING-POS 1 0 (lambda (i) (= 8 (A166040 i)))))
Sequence in context: A089297 A250291 A127956 * A295490 A172195 A161724
Adjacent sequences: A166085 A166086 A166087 * A166089 A166090 A166091
Antti Karttunen, Oct 08 2009