A358196 Numbers k such that 5^k and 8^k have the same leading digit.
0, 5, 9, 15, 19, 29, 34, 39, 44, 49, 54, 59, 98, 102, 108, 112, 118, 122, 132, 137, 142, 147, 152, 162, 191, 195, 201, 205, 211, 215, 225, 230, 235, 240, 245, 250, 255, 284, 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
Offset: 1
Examples
5 is a term because 5^5 = 3125 and 8^5 = 32768; 9 is a term because 5^9 = 1953125 and 8^9 = 134217728.
Links
- Nicolay Avilov, Problem 2405. 4 and 5 (in Russian).
Programs
-
Mathematica
Select[Range[0, 500], Equal @@ IntegerDigits[{5, 8}^#][[;; , 1]] &] (* Amiram Eldar, Nov 02 2022 *)
-
PARI
isok(k) = digits(5^k)[1] == digits(8^k)[1]; \\ Michel Marcus, Nov 02 2022
-
Python
def ok(n): return str(5**n)[0] == str(8**n)[0] print([k for k in range(501) if ok(k)]) # Michael S. Branicky, Nov 03 2022
Comments