login
Let p = prime(n); then a(n) = number of residues p mod q which are prime, as q runs through the primes less than p.
1

%I #7 Mar 29 2015 16:30:09

%S 0,0,1,1,1,2,3,2,3,3,3,4,4,3,5,4,5,3,3,5,6,6,4,7,6,5,6,6,6,8,6,7,9,6,

%T 8,6,8,9,6,7,8,9,8,10,10,7,8,8,7,9,11,11,11,10,10,9,10,10,13,11,11,12,

%U 11,12,12,11,9,11,11,10,12,15,13,14,13,13,12,12,16,14,14,12,14,14,15,14,15

%N Let p = prime(n); then a(n) = number of residues p mod q which are prime, as q runs through the primes less than p.

%C Number of prime prime residues of the n-th prime.

%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_301.htm">Prime Puzzle 301</a>

%e a(6)=2: the 6th prime is 13. 13 mod 2 = 1; 13 mod 3 = 1; 13 mod 5 = 3 (prime); 13 mod 7 = 6; 13 mod 11 = 2 (prime).

%t f[n_] := Length[ Select[ Mod[ Prime[n], Prime[ Range[n]]], PrimeQ[ # ] &]]; Table[ f[n], {n, 87}] (* _Robert G. Wilson v_, Feb 22 2005 *)

%Y Cf. A102854.

%K nonn

%O 1,6

%A _Ray G. Opao_, Feb 21 2005

%E More terms from _Robert G. Wilson v_, Feb 22 2005