I have a sequence:
$ 7,19,61,193,577,1633,4417, ... $
and I'd like to find out how many primes and semiprimes there are in this sequence up to the first thousand terms? Any idea how I could do that quickly?
To form the sequence I did: $ 3(2)+1, 6(3)+1, 12(5)+1, 24(8)+1, 48(12)+1, 96(17)+1, ... $
i.e. : $ 3+3+1, 6+6+6+1, 12+12+12+12+12+1, ... $
There are $24$ primes in the first $1000$ terms, namely terms number $$1, 2, 3, 4, 5, 12, 21, 23, 24, 27, 46, 47, 48, 50, 54, 65, 68, 101, 159, 286, 483, 572, 802, 873$$
There's no shortcut, just generate the terms and test for primality. Fortunately, that's quite fast. In Maple on my computer it took less than half a second.
Counting the semiprimes would be harder, I think, because I don't know of a way to test for semiprimes that's much faster than factoring, and the $1000$'th term has $307$ digits - no picnic to factor.