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!)
A162145 a(n) = the number of noncomposites (primes or 1) that are n digits long when written in binary. 7

%I #19 Sep 08 2022 08:45:46

%S 1,2,2,2,5,7,13,23,43,75,137,255,464,872,1612,3030,5709,10749,20390,

%T 38635,73586,140336,268216,513708,985818,1894120,3645744,7027290,

%U 13561907,26207278,50697537,98182656,190335585,369323305,717267168

%N a(n) = the number of noncomposites (primes or 1) that are n digits long when written in binary.

%H Lei Zhou, <a href="/A162145/b162145.txt">Table of n, a(n) for n = 1..47</a>

%F a(n) = A036378(n-1), n>2. - _R. J. Mathar_, Jun 27 2009

%e The consecutive primes 17 (10001 in binary), 19 (10011 in binary), 23 (10111 in binary), 29 (11101 in binary), and 31 (11111 in binary) are the only primes each written with exactly 5 digits in binary. There are 5 of these primes, so a(5) = 5.

%t Table[PrimePi[2^(d + 1)] - PrimePi[2^d-1], {d, 1, 46}] (*_Lei Zhou_ Dec 17 2013; this is capable of generating terms 1..47 *)

%t Join[{1, 2}, t=Table[PrimePi[2^n], {n, 2, 40}]; Rest@t - Most@t] (* _Vincenzo Librandi_, Dec 08 2015 *)

%o (Magma) [#PrimesInInterval(2^n, 2^(n+1)): n in [0..25]]; // _Vincenzo Librandi_, Dec 08 2015

%Y Cf. A004676.

%Y Same as A036378 except for a(1). - _Franklin T. Adams-Watters_, May 25 2010

%K base,nonn

%O 1,2

%A _Leroy Quet_, Jun 25 2009

%E More terms from _Franklin T. Adams-Watters_, May 25 2010

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 April 24 13:30 EDT 2024. Contains 371957 sequences. (Running on oeis4.)