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 A339255 #11 Sep 04 2021 19:12:50 %S A339255 1,2,3,4,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1, %T A339255 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, %U A339255 2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3 %N A339255 Leading digit of n in base 5. %H A339255 Kevin Ryde, <a href="/A339255/b339255.txt">Table of n, a(n) for n = 1..10000</a> %F A339255 a(n) = floor(n / 5^floor(log_5(n))). %F A339255 G.f.: (x + Sum_{k>=0} Sum_{d=2..4} (x^(d*5^k)-x^(5^(k+1))) )/(1-x). %t A339255 IntegerDigits[#,5][[1]]&/@Range[100] (* _Harvey P. Dale_, Sep 04 2021 *) %o A339255 (PARI) a(n) = n\5^logint(n,5); %Y A339255 Cf. A007091 (base 5), A073851 (partial sums). %Y A339255 In other bases: A122586, A122587, A339256, A000030, A099563, A276153. %K A339255 base,nonn %O A339255 1,2 %A A339255 _Kevin Ryde_, Nov 28 2020