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.

A367296 Numbers k such that 8 is the first digit of 2^k.

This page as a plain text file.
%I A367296 #20 Nov 12 2024 18:23:18
%S A367296 3,13,23,33,43,106,116,126,136,146,199,209,219,229,239,302,312,322,
%T A367296 332,342,395,405,415,425,435,498,508,518,528,538,591,601,611,621,631,
%U A367296 684,694,704,714,724,787,797,807,817,827,880,890,900,910,920,983,993,1003
%N A367296 Numbers k such that 8 is the first digit of 2^k.
%C A367296 The asymptotic density of this sequence is log_10(9/8) = 0.051152...
%H A367296 Robert Israel, <a href="/A367296/b367296.txt">Table of n, a(n) for n = 1..10000</a>
%p A367296 x := 1:
%p A367296 L := []:
%p A367296 for n from 0 to 10^3 do
%p A367296   if 8 <= x and x < 9 then
%p A367296     L := [op(L), n]
%p A367296   fi;
%p A367296   x := 2*x;
%p A367296   if x > 10 then
%p A367296     x := (1/10)*x fi;
%p A367296 od:
%p A367296 L;
%p A367296 # alternative:
%p A367296 select(t -> floor(2^t/10^ilog10(2^t))=8, [$1..10^4]); # _Robert Israel_, Nov 12 2024
%t A367296 Select[Range[1010], IntegerDigits[2^#][[1]] == 8 &] (* _Amiram Eldar_, Nov 12 2023 *)
%o A367296 (Python)
%o A367296 from itertools import islice
%o A367296 def A367296_gen(): # generator of terms
%o A367296     a, b, c, l = 8, 9, 1, 0
%o A367296     while True:
%o A367296         if a<=c:
%o A367296             if c<b:
%o A367296                 yield l
%o A367296             a *= 10
%o A367296             b *= 10
%o A367296         c <<= 1
%o A367296         l += 1
%o A367296 A367296_list = list(islice(A367296_gen(),30)) # _Chai Wah Wu_, Nov 13 2023
%Y A367296 Cf. A000079, A067497, A067469, A172404, A367294, A363060, A367295, A330243, A097415.
%K A367296 nonn,base
%O A367296 1,1
%A A367296 _Martin Renner_, Nov 12 2023