A358197 Numbers k such that 2^k, 5^k and 8^k have the same first digit.
0, 5, 15, 98, 108, 118, 191, 201, 211, 284, 294, 304, 387, 397, 407, 480, 490, 500, 583, 593, 603, 676, 686, 696, 779, 789, 872, 882, 892, 965, 975, 985, 1068, 1078, 1088, 1161, 1171, 1181, 1264, 1274, 1284, 1357, 1367, 1377, 1450, 1460, 1470, 1553, 1563, 1573, 1646, 1656, 1666
Offset: 1
Examples
5 is a term because the first digit of 2^5 = 32, 5^5 = 3125, 8^5 = 32768 is 3. 15 is a term because the first digit of 2^15 = 32768, 5^15 = 30517578125, 8^15 = 35184372088832 is 3.
Programs
-
Maple
ld:= n -> floor(n/10^ilog10(n)):filter:= proc(k) local d; d:= ld(2^k); ld(5^k) = d and ld(8^k) = d end proc:select(filter, [$0..2000]); # Robert Israel, Nov 02 2022
-
Mathematica
Select[Range[0, 1666], Equal @@ IntegerDigits[{2, 5, 8}^#][[;; , 1]] &] (* Amiram Eldar, Nov 02 2022 *)
-
Python
def ok(n): return str(2**n)[0] == str(5**n)[0] == str(8**n)[0] print([k for k in range(1667) if ok(k)]) # Michael S. Branicky, Nov 03 2022
Comments