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.
%I A382184 #9 Mar 20 2025 09:29:22 %S A382184 0,1,1,3,4,5,1,7,3,9,10,11,4,13,5,15,16,17,18,19,20,21,22,23,1,25,7, %T A382184 27,28,29,3,31,9,33,34,35,10,37,11,39,40,41,42,43,44,45,46,47,4,49,13, %U A382184 51,52,53,5,55,15,57,58,59,16,61,17,63,64,65,66,67,68,69 %N A382184 a(n) is the least k >= 0 such that the factorial base expansion of n starts with that of k while the remaining digits are zeros. %H A382184 Rémy Sigrist, <a href="/A382184/b382184.txt">Table of n, a(n) for n = 0..10000</a> %H A382184 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a> %F A382184 a(n) <= n with equality iff n = 0 or n belongs to A273670. %F A382184 a(k!) = 1 for any k >= 0. %e A382184 The first terms, in decimal and in factorial base, are: %e A382184 n a(n) fact(n) fact(a(n)) %e A382184 -- ---- ------- ---------- %e A382184 0 0 0 0 %e A382184 1 1 1 1 %e A382184 2 1 1,0 1 %e A382184 3 3 1,1 1,1 %e A382184 4 4 2,0 2,0 %e A382184 5 5 2,1 2,1 %e A382184 6 1 1,0,0 1 %e A382184 7 7 1,0,1 1,0,1 %e A382184 8 3 1,1,0 1,1 %e A382184 9 9 1,1,1 1,1,1 %e A382184 10 10 1,2,0 1,2,0 %e A382184 11 11 1,2,1 1,2,1 %e A382184 12 4 2,0,0 2,0 %e A382184 13 13 2,0,1 2,0,1 %e A382184 14 5 2,1,0 2,1 %e A382184 15 15 2,1,1 2,1,1 %o A382184 (PARI) a(n) = { if (n, my (m = n, s = oo, d); for (r = 2, oo, if (m==0 || s==0, break, d = m%r, s = min(s, r-1-d);); m \= r;); if (s, my (v = 0); for (r = 2, oo, if (n==0, return (v), v += (n%r) * max(0, r-1-s)!; n \= r;);););); return (n); } %Y A382184 Cf. A000265, A004151, A153880, A273670, A382177, A382217. %K A382184 nonn,base %O A382184 0,4 %A A382184 _Rémy Sigrist_, Mar 17 2025