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.

A215894 a(n) = floor(2^n / n^k), where k is the largest integer such that 2^n >= n^k.

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 4, 6, 1, 1, 2, 3, 5, 9, 1, 1, 2, 4, 6, 10, 17, 1, 2, 3, 5, 9, 15, 26, 1, 2, 4, 6, 11, 18, 31, 1, 2, 4, 6, 11, 19, 32, 1, 2, 3, 5, 9, 16, 28, 49, 1, 2, 4, 7, 13, 22, 38, 1, 1, 3, 5, 9, 16, 27, 47, 1, 2, 3, 5, 10, 17, 30, 51, 1, 2, 3, 5, 10
Offset: 2

Views

Author

Alex Ratushnyak, Aug 25 2012

Keywords

Comments

a(n) < n.
n such that a(n) = n-1: 2, 3, 996, 3389, 149462.

Examples

			a(2) = floor(2^2 / 2^2) = 1,
a(3) = floor(2^3 / 3) = 2,
a(4)..a(9) are floor(2^n / n^2),
a(10)..a(15) are floor(2^n / n^3),
a(16)..a(22) are floor(2^n / n^4), and so on.
		

Crossrefs

Programs

  • Magma
    [Floor(2^n div n^Floor(n *Log(n,2))): n in [2..100]]; // Vincenzo Librandi, Jan 09 2019
  • Mathematica
    Table[Floor[2^n/n^Floor[n Log[n, 2]]], {n, 2, 64}] (* Alonso del Arte, Aug 26 2012 *)
  • Python
    import math
    def modiv(a,b):
        return a - b*(a//b)
    def modlg(a,b):
        return a // b**int(math.log(a,b))
    for n in range(2,100):
        a = 2**n
        print(modlg(a,n), end=',')
    

Formula

a(n) = modlg(2^n, n) = floor(2^n / n^floor(n*logn(2))), where logn is the logarithm base n.
In the base-b representation of k, modlg(k,b) is the most significant digit: k = c0 + c1*b + c2*b^2 + ... + cn*b^n, cn = modlg(k,b), c0 = k mod b. - Alex Ratushnyak, Aug 30 2012