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.

A246359 Maximum digit in the factorial base expansion of n (A007623).

This page as a plain text file.
%I A246359 #29 Mar 24 2021 09:52:04
%S A246359 0,1,1,1,2,2,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,1,1,1,1,2,2,1,1,1,1,
%T A246359 2,2,2,2,2,2,2,2,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,
%U A246359 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4
%N A246359 Maximum digit in the factorial base expansion of n (A007623).
%C A246359 Maximum entry in n-th row of A108731.
%H A246359 Antti Karttunen, <a href="/A246359/b246359.txt">Table of n, a(n) for n = 0..10080</a>
%H A246359 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>
%F A246359 From _Antti Karttunen_, Aug 29 2016: (Start)
%F A246359 a(0) = 0; for n >= 1, a(n) = 1 + a(A257684(n)).
%F A246359 a(0) = 0; for n >= 1, a(n) = max(A099563(n), a(A257687(n))).
%F A246359 a(n) = A051903(A276076(n)).
%F A246359 (End)
%e A246359 Factorial base representation of 46 is "1320" as 46 = 1*4! + 3*3! + 2*2! + 0*1!, and the largest of these digits is 3, thus a(46) = 3.
%t A246359 nn = 96; m = 1; While[Factorial@ m < nn, m++]; m; Table[Max@ IntegerDigits[n, MixedRadix[Reverse@ Range[2, m]]], {n, 0, nn}] (* Version 10.2, or *)
%t A246359 f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Range[# + 1] <= n &]; Most@ Rest[a][[All, 1]] /. {} -> {0}]; Table[Max@ f@ n, {n, 0, 96}] (* _Michael De Vlieger_, Aug 29 2016 *)
%o A246359 (MIT/GNU Scheme) (define (A246359 n) (let loop ((n n) (i 2) (md 0)) (if (zero? n) md (loop (floor->exact (/ n i)) (+ i 1) (max (modulo n i) md)))))
%o A246359 (Python)
%o A246359 def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
%o A246359 def a(n): return int(max(str(a007623(n))))
%o A246359 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 21 2017
%Y A246359 Cf. A007623, A034968, A051903, A060130, A084558, A099563, A257684, A257687, A276076.
%Y A246359 Cf. also A249070.
%K A246359 nonn,base
%O A246359 0,5
%A A246359 _Antti Karttunen_, Oct 20 2014