[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A163400
Number of bits in binary expansion of n-th nonprime.
3
1, 1, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8
OFFSET
1,3
COMMENTS
Here n-th nonprime=A141468(n).
For n > 2, a(n) = A029837(n) or A029837(n)+1.
EXAMPLE
a(1)=1(0=nonprime(1) written in base 2 and 10); a(2)=1(1=nonprime(2) written in base 2 and 10); a(3)=3(100=nonprime(3) written in base 2 where 4=nonprime(3) written in base 10).
MAPLE
A141468 := proc(n) option remember; if n = 1 then 0; else for a from procname(n-1)+1 do if not isprime(a) then return a; fi; od: fi; end: A070939 := proc(n) max(1, ilog2(n)+1) ; end: A163400 := proc(n) A070939(A141468(n)) ; end: seq(A163400(n), n=1..120) ; # R. J. Mathar, Oct 10 2009
MATHEMATICA
Prepend[Flatten@ Array[If[PrimeQ[ # ], {}, IntegerLength[ #, 2]] &, 100000], 1] (* Jasper Mulder (jasper.mulder(AT)planet.nl), Jun 03 2010 *)
CROSSREFS
Sequence in context: A298199 A282623 A090589 * A090972 A318241 A181742
KEYWORD
nonn,easy,base
AUTHOR
EXTENSIONS
Edited by Charles R Greathouse IV, Mar 22 2010
STATUS
approved