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 A358196 #31 Dec 26 2022 09:47:37 %S A358196 0,5,9,15,19,29,34,39,44,49,54,59,98,102,108,112,118,122,132,137,142, %T A358196 147,152,162,191,195,201,205,211,215,225,230,235,240,245,250,255,284, %U A358196 294,298,304,308,318,328,333,338,343,348,387,391,397,401,407,411,421,426,431,436,441,446,451,480,490,494,500 %N A358196 Numbers k such that 5^k and 8^k have the same leading digit. %C A358196 Write lg = log_10, let {x} denote the fractional part of x. Note that {k*lg(5)} = 1 - {k*lg(2)} and that {k*lg(8)} = {k*lg(2)} + 0, 1, or 2, so we have {k > 0 : 5^k and 8^k both start with a} = {k: {k*lg(2)} is in I_a}, where I_a = (1-lg(a+1), 1-lg(a)) intersect (((lg(a))/3, (lg(a+1))/3) U ((lg(a)+1)/3, (lg(a+1)+1)/3) U ((lg(a)+2)/3, (lg(a+1)+2)/3)). Note that I_1 = (1-lg(2), (lg(2)+2)/3), I_3 = ((lg(3)+1)/3, 1-lg(3)), I_5 = (lg(5)/3, lg(6)/3) and that I_a is empty otherwise. As a result, k > 0 is a term if and only if {k*lg(2)} is in (lg(5)/3, lg(6)/3) U ((lg(3)+1)/3, 1-lg(3)) U (1-lg(2), (lg(2)+2)/3). We see that when 5^k and 8^k both start with 1, 3, or 5, 2^k starts with 5, 3, or 1 respectively. - _Jianing Song_, Dec 26 2022 %H A358196 Nicolay Avilov, <a href="https://www.diofant.ru/problem/4197/">Problem 2405. 4 and 5</a> (in Russian). %e A358196 5 is a term because 5^5 = 3125 and 8^5 = 32768; %e A358196 9 is a term because 5^9 = 1953125 and 8^9 = 134217728. %t A358196 Select[Range[0, 500], Equal @@ IntegerDigits[{5, 8}^#][[;; , 1]] &] (* _Amiram Eldar_, Nov 02 2022 *) %o A358196 (PARI) isok(k) = digits(5^k)[1] == digits(8^k)[1]; \\ _Michel Marcus_, Nov 02 2022 %o A358196 (Python) %o A358196 def ok(n): return str(5**n)[0] == str(8**n)[0] %o A358196 print([k for k in range(501) if ok(k)]) # _Michael S. Branicky_, Nov 03 2022 %Y A358196 Cf. A000351, A001018, A088935, A111395. %K A358196 nonn,base %O A358196 1,2 %A A358196 _Nicolay Avilov_, Nov 02 2022