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.

This page as a plain text file.
%I A216021 #11 Jan 01 2025 14:40:38
%S A216021 1,1,3,1,3,11,50,1,2,9,33,129,550,2526,12445,1,2,8,26,86,302,1103,
%T A216021 4216,16834,70064,303520,1366413,6383595,30907397,154895272,802588710,
%U A216021 1,2,7,23,69,215,685,2242,7523,25881,91237,329377,1217078,4600595,17781207,70234475
%N 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.
%C A216021 a(2^k) = 1.
%C A216021 In base B representation of A, modlg(A,B) is the most significant digit:
%C A216021 A = C0 + C1*B + C2*B^2 + ... + Cn*B^n, Cn = modlg(A,B), C0 = A mod B.
%e A216021 a(5) = modlg(5^5, 2^5) = floor(3125 / 32^floor(log32(3125))) = floor(3125/32^2) = 3.
%e A216021 a(7) = modlg(7^7, 2^7) = floor(823543 / 128^floor(log128(823543))) = floor(823543/128^2) = 50.
%o A216021 (Python)
%o A216021 import math
%o A216021 def modiv(a, b):
%o A216021     return a - b*int(a//b)
%o A216021 def modlg(a, b):
%o A216021     return a // b**int(math.log(a, b))
%o A216021 for n in range(1, 77):
%o A216021     print(modlg(n**n, 2**n), end=', ')
%Y A216021 Cf. A215894.
%K A216021 nonn
%O A216021 1,3
%A A216021 _Alex Ratushnyak_, Aug 29 2012