A109381 Maximum digit of n^2 written in factorial base.
0, 1, 2, 1, 2, 1, 2, 2, 2, 3, 4, 1, 1, 2, 3, 4, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 1, 2, 1, 2, 2, 2, 3, 3, 4, 4, 5, 2, 3, 2, 2, 3, 3, 4, 4, 5, 3, 3, 3, 4, 3, 4, 5, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 1, 1, 2, 3, 4, 2, 2, 3, 4, 5, 3, 2, 3, 4, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 2, 3, 4, 2
Offset: 0
Examples
4^2 = 16 = 2*6+2*2 = 220(factorial base), so a(4) = max(2,2,0) = 2.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..20954
Programs
-
Maple
b:= proc(n, i) local r; `if`(n b(n^2, 2): seq(a(n), n=0..188); # Alois P. Heinz, Mar 28 2018
-
Mathematica
Block[{nn = 105^2, r}, r = Reverse@ Most@ NestWhileList[# + 1 &, 2, #! < nn &]; Array[Max@ IntegerDigits[#^2, MixedRadix@ r] &, Sqrt@ nn, 0]] (* Michael De Vlieger, Jan 01 2019 *)
-
PARI
f(n, p=2) = if( n
A007623 a(n) = my(dfb=digits(f(n^2))); if (#dfb, vecmax(dfb), 0); \\ Michel Marcus, Mar 28 2018
Comments