%I #11 Mar 31 2012 13:21:28
%S 3,7,31,127,3583,8191,131071,524287,14680063,1073479679,2147483647,
%T 266287972351,4260607557631,17591112302591,246290604621823,
%U 17996806323437567,1152917106560335871,2305843009213693951
%N a(n) is the smallest prime such that the number of 1's in its binary expansion is equal to the n-th prime.
%C a(n) = Min{p: A000120(p)=A000040(n), p prime}.
%C If 2^(Prime[n]) - 1 is a prime number, then a(n) = 2^(Prime[n]) - 1, where Prime[n] denotes the n-th prime number. This means that every Mersenne prime arises in this sequence. - _Stefan Steinerberger_, Jan 22 2006
%C For all n with prime(n) < 300, a(n) has either prime(n) or prime(n)+1 bits. - _David Wasserman_, Oct 25 2006
%F a(n) = A061712(A000040(n)). - _Franklin T. Adams-Watters_, Jun 06 2006
%e n=4, p[4]=11, 3583=[11011111111] has 11 digits=1 and is prime;
%e 2047=23.89=[11111111111] is not here because it is composite.
%e a(5)=3583=A081092(266)=A000040(502) having eleven 1's: '110111111111' and A000120(p)<11=prime(5) for primes p<3583.
%e Mersenne-primes are here, Mersenne composites not.
%t Do[k=1;While[Count[IntegerDigits[Prime[k], 2], 1] !=Prime[n], k++ ];Print[Prime[k]], {n, 1, 10}]
%Y Cf. A000043, A000668, A001348, A061712, A000120, A014499.
%Y Cf. A000040, A000120, A081092.
%K base,nonn
%O 1,1
%A _Reinhard Zumkeller_, Mar 05 2003
%E More terms from _Franklin T. Adams-Watters_, Jun 06 2006
%E Further terms from _David Wasserman_, Oct 25 2006
%E Edited by _N. J. A. Sloane_, Sep 15 2008 at the suggestion of R. J. Mathar