The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A139102 Numbers whose binary representation shows the distribution of prime numbers up to the n-th prime minus 1, using "0" for primes and "1" for nonprime numbers. 9
 1, 2, 9, 37, 599, 2397, 38359, 153437, 2454999, 157119967, 628479869, 40222711647, 643563386359, 2574253545437, 41188056726999, 2636035630527967, 168706280353789919, 674825121415159677, 43188807770570219359, 691020924329123509751, 2764083697316494039005 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS a(n) is the decimal representation of A139101(n) interpreted as binary number. LINKS FORMULA a(n) = A139104(n)/2. EXAMPLE a(4)=37 because 37 written in base 2 is 100101 and the string "100101" shows the distribution of prime numbers up to the 4th prime minus 1, using "0" for primes and "1" for nonprime numbers. MAPLE A139101 := proc(n) option remember ; local a, p; if n = 1 then RETURN(1); else a := 10*A139101(n-1) ; for p from ithprime(n-1)+1 to ithprime(n)-1 do a := 10*a+1 ; od: fi ; RETURN(a) ; end: # R. J. Mathar, Apr 25 2008 bin2dec := proc(n) local nshft ; nshft := convert(n, base, 10) ; add(op(i, nshft)*2^(i-1), i=1..nops(nshft) ) ; end: # R. J. Mathar, Apr 25 2008 A139102 := proc(n) bin2dec(A139101(n)) ; end: # R. J. Mathar, Apr 25 2008 seq(A139102(n), n=1..35) ; # R. J. Mathar, Apr 25 2008 MATHEMATICA Table[ sum = 0; For[i = 1, i <= Prime[n] - 1 , i++, sum = sum*2; If[! PrimeQ[i], sum++]]; sum, {n, 1, 25}] (* Robert Price, Apr 03 2019 *) PROG (PARI) a(n) = fromdigits(vector(prime(n)-1, k, !isprime(k)), 2); \\ Michel Marcus, Apr 04 2019 CROSSREFS Subset of A118255. Cf. A000040, A018252, A139101, A139103, A139104, A139119, A139120, A139122. Sequence in context: A218943 A122673 A241454 * A195187 A041515 A010750 Adjacent sequences:  A139099 A139100 A139101 * A139103 A139104 A139105 KEYWORD nonn,base AUTHOR Omar E. Pol, Apr 08 2008 EXTENSIONS More terms from R. J. Mathar, Apr 25 2008 a(20)-a(21) from Robert Price, Apr 03 2019 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 21 08:03 EDT 2021. Contains 343146 sequences. (Running on oeis4.)