cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A035100 Number of bits in binary expansion of n-th prime.

Original entry on oeis.org

2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    Digits := 40: [ seq(1+floor(evalf(log(ithprime(n))/log(2))), n=1..100) ];
  • Mathematica
    f[n_]:=Length[IntegerDigits[Prime[n],2]]; Table[f[n],{n,5!}] (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010 *)
    IntegerLength[Prime[Range[100]],2] (* Harvey P. Dale, Nov 10 2022 *)
  • PARI
    a(n)=#binary(prime(n)) \\ Charles R Greathouse IV, Sep 23 2012
    
  • Python
    from sympy import prime
    def A035100(n): return prime(n).bit_length() # Chai Wah Wu, Nov 19 2024