cp's OEIS Frontend

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.

A358197 Numbers k such that 2^k, 5^k and 8^k have the same first digit.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The first digit of 2^k is A008952(k) = floor(10^{k*log_10(2)}), the first digit of 5^k is A111395(k) = floor(10^{k*log_10(5)}), and the first digit of 8^k is A008952(3*k) = floor(10^{k*log_10(8)}), where "{x}" denotes the fractional part of x.
All numbers 2^k, 5^k, 8^k for k = a(n) > 0 start only with 3.
From Jianing Song, Dec 26 2022: (Start)
Write lg = log_10. 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 : 2^k, 5^k, 8^k all start with a} = {k: {k*lg(2)} is in I_a}, where I_a = (lg(a), lg(a+1)) intersect (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_3 = ((lg(3)+1)/3, 1-lg(3)) and I_a is empty otherwise (since (lg(a), lg(a+1)) intersect (1-lg(a+1), 1-lg(a)) is empty). As a result, k > 0 is a term if and only if (lg(3)+1)/3 < {k*lg(2)} < 1-lg(3).
Except for 0, also numbers k in A358196 such that 2^k starts with 3 (see the comment in A358196).
Claim: for n > 1, a(n+1) - a(n) = 10, 73, or 83. Proof: write a = (lg(3)+1)/3, b = 1-lg(3).
Step 1. If k > 0 is a term, then:
(a) {k*lg(2)} is in (a, b-(10*lg(2)-3)) => {(k+10)*lg(2)} is in (a+(10*lg(2)-3), b) => k+10 is a term;
(b) {k*lg(2)} is in (a+(25-83*lg(2)), b) => {(k+83)*lg(2)} is in (a, b-(25-83*lg(2))) => k+83 is a term.
Note that (a, b-(10*lg(2)-3)) U (a+(25-83*lg(2)), b) = (a, b), so at least one of k+10 and k+83 is a term.
Step 2. If k > 0 and k+m are both terms, 0 < m <= 83, then {k*lg(2)} and {(k+m)*lg(2)} are both in (a, b), so m*lg(2) is the range (N-(b-a), N+(b-a)) for some integer N, which implies that m = 10, 20, 73, or 83.
Note that if {k*lg(2)} < 1 - 2*(10*lg(2)-3), then {(k+10)*lg(2)} = {k*lg(2)} + (10*lg(2)-3), {(k+20)*lg(2)} = {k*lg(2)} + 2*(10*lg(2)-3), so {k*lg(2)} < {(k+10)*lg(2)} < {(k+20)*lg(2)}, which means that if k and k+20 are both terms, so is k+10. This shows that the next term after k is either 10, 73, or 83 larger.
We can show similarly that, for k > 0 being a term of this sequence:
(a) if k+73 is a term, then k+83 is a term;
(b) if k+83 is a term, then k+93 is a term;
(c) if k+166 is a term, then k+73 is a term;
(d) if k+10, k+73 are not terms (i.e., the next term is k+83), then k+176, k+196 are terms.
As a result, if we write out the sequence of the first differences, 73 is always followed by two 10's, and 83 is followed by one or two 10's; 83, 10, 10 is always followed by 73, 10, 10, and 83, 10 is always followed by 83, 10, 10. (End)

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.
		

Crossrefs

Intersection of A088935 and A358196.

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