A081093 a(n) is the smallest prime such that the number of 1's in its binary expansion is equal to the n-th prime.
3, 7, 31, 127, 3583, 8191, 131071, 524287, 14680063, 1073479679, 2147483647, 266287972351, 4260607557631, 17591112302591, 246290604621823, 17996806323437567, 1152917106560335871, 2305843009213693951
Offset: 1
Examples
n=4, p[4]=11, 3583=[11011111111] has 11 digits=1 and is prime; 2047=23.89=[11111111111] is not here because it is composite. a(5)=3583=A081092(266)=A000040(502) having eleven 1's: '110111111111' and A000120(p)<11=prime(5) for primes p<3583. Mersenne-primes are here, Mersenne composites not.
Programs
-
Mathematica
Do[k=1;While[Count[IntegerDigits[Prime[k], 2], 1] !=Prime[n], k++ ];Print[Prime[k]], {n, 1, 10}]
Formula
Extensions
More terms from Franklin T. Adams-Watters, Jun 06 2006
Further terms from David Wasserman, Oct 25 2006
Edited by N. J. A. Sloane, Sep 15 2008 at the suggestion of R. J. Mathar
Comments