%I #4 Dec 05 2013 19:57:14
%S 5,3,5,7,41,11,13,0,17,19,0,23,101,67,29,31,131,137,37,151,41,43,109,
%T 47,463,0,53,0,137,59,61,0,0,67,163,71,73,0,0,79,0,83,317,677,89,457,
%U 0,347,97,0,101,103,0,107,109,257,113,419,271,431,439,1733,617,127,467,131
%N Smallest prime == 2n-1 (mod composite(2n-1)), or 0 if impossible.
%e a(8)=0 because the 15th composite is 30 and no prime is congruent to 15 (mod 30).
%t f[n_] := Block[{k = 1, m = FixedPoint[2n + PrimePi[ # ] &, 2n - 1]}, While[k < 100000 && Mod[Prime[k], m] != 2n - 1, k++ ]; If[k == 100000, 0, Prime[k]]]; Table[ f[n], {n, 67}] (* _Robert G. Wilson v_ *)
%K nonn
%O 1,1
%A _Amarnath Murthy_, Nov 15 2005
%E Corrected and extended by _Robert G. Wilson v_, Nov 17 2005