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.

A216021 a(n) = modlg(n^n, 2^n), where modlg is the function defined in A215894: modlg(a,b) = floor(a / b^floor(logb(a))), logb is the logarithm base b.

Original entry on oeis.org

1, 1, 3, 1, 3, 11, 50, 1, 2, 9, 33, 129, 550, 2526, 12445, 1, 2, 8, 26, 86, 302, 1103, 4216, 16834, 70064, 303520, 1366413, 6383595, 30907397, 154895272, 802588710, 1, 2, 7, 23, 69, 215, 685, 2242, 7523, 25881, 91237, 329377, 1217078, 4600595, 17781207, 70234475
Offset: 1

Views

Author

Alex Ratushnyak, Aug 29 2012

Keywords

Comments

a(2^k) = 1.
In base B representation of A, modlg(A,B) is the most significant digit:
A = C0 + C1*B + C2*B^2 + ... + Cn*B^n, Cn = modlg(A,B), C0 = A mod B.

Examples

			a(5) = modlg(5^5, 2^5) = floor(3125 / 32^floor(log32(3125))) = floor(3125/32^2) = 3.
a(7) = modlg(7^7, 2^7) = floor(823543 / 128^floor(log128(823543))) = floor(823543/128^2) = 50.
		

Crossrefs

Cf. A215894.

Programs

  • Python
    import math
    def modiv(a, b):
        return a - b*int(a//b)
    def modlg(a, b):
        return a // b**int(math.log(a, b))
    for n in range(1, 77):
        print(modlg(n**n, 2**n), end=', ')