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.

A098388 a(n) = floor(log_2(prime(n))).

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 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, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 06 2004

Keywords

Comments

a(n) is the greatest k such that 2^k does not exceed prime(n). - David James Sycamore, Sep 14 2021
a(n) is the number of representations of prime(n) as a sum 2^m+r, where 1 <= r < prime(n): a(5) = 3 because prime(5) = 11 = 2^3 + 3 = 2^2 + 7 = 2^1 + 9. - Clark Kimberling, Feb 06 2025

Crossrefs

Programs

  • Maple
    map(ilog2, select(isprime,[2,seq(2*i+1,i=1..1000)])); # Robert Israel, Jun 08 2015
  • Mathematica
    Floor[Log[2, Prime[Range[105]]]] (* data *) (* parameter changed by Hartmut F. W. Hoft, Jun 02 2015 *)
  • PARI
    a(n) = logint(prime(n), 2); \\ Michel Marcus, Sep 17 2017
    
  • Python
    from sympy import prime
    def A098388(n): return prime(n).bit_length()-1 # Chai Wah Wu, Nov 19 2024

Formula

a(n) = A000523(A000040(n)); A098391(n) = A000523(a(n)).
a(n) = A035100(n) - 1. - Michel Marcus, Sep 17 2017