The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A139104 Numbers whose binary representation shows the distribution of prime numbers up to the n-th prime, using "0" for primes and "1" for nonprime numbers. 10
2, 4, 18, 74, 1198, 4794, 76718, 306874, 4909998, 314239934, 1256959738, 80445423294, 1287126772718, 5148507090874, 82376113453998, 5272071261055934, 337412560707579838, 1349650242830319354, 86377615541140438718, 1382041848658247019502, 5528167394632988078010 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) is the decimal representation of A139103(n) interpreted as binary number.
LINKS
FORMULA
a(n) = 2 * A139102(n).
From Ridouane Oudra, Aug 27 2019: (Start)
a(n) = 2^prime(n) - 1 - (1/2)*(n + Sum_{i=1..prime(n)} 2^(prime(n)-i)*pi(i)), where prime(n) = A000040(n) and pi(n) = A000720(n)
a(n) = A001348(n) - A121240(n)
a(n) = A118255(A000040(n)). (End)
EXAMPLE
a(4)=74 because 74 written in base 2 is 1001010 and the string "1001010" shows the distribution of prime numbers up to the 4th prime, using "0" for primes and "1" for nonprime numbers.
MATHEMATICA
Table[ sum = 0; For[i = 1, i <= Prime[n] , i++, sum = sum*2;
If[! PrimeQ[i], sum++]]; sum, {n, 1, 21}] (* Robert Price, Apr 03 2019 *)
Module[{nn=30, t}, t=Table[If[PrimeQ[n], 0, 1], {n, Prime[nn]}]; Table[ FromDigits[ Take[t, p], 2], {p, Prime[Range[nn]]}]] (* Harvey P. Dale, Jul 15 2019 *)
PROG
(PARI) a(n) = fromdigits(vector(prime(n), k, !isprime(k)), 2); \\ Michel Marcus, Apr 04 2019
CROSSREFS
Subset of A118255.
Sequence in context: A174085 A325850 A052689 * A014448 A277033 A295767
KEYWORD
nonn
AUTHOR
Omar E. Pol, Apr 08 2008
EXTENSIONS
More terms from R. J. Mathar, May 22 2008
a(19)-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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 29 22:36 EDT 2024. Contains 372954 sequences. (Running on oeis4.)