%I #36 Nov 13 2023 10:01:34
%S 9,19,29,39,49,59,69,102,112,122,132,142,152,162,172,195,205,215,225,
%T 235,245,255,265,298,308,318,328,338,348,358,391,401,411,421,431,441,
%U 451,461,494,504,514,524,534,544,554,587,597,607,617,627,637,647,657,680,690
%N Numbers k such that 5 is the first digit of 2^k.
%C The asymptotic density of this sequence is log_10(6/5) = 0.0791812... . - _Amiram Eldar_, May 16 2023
%C In base B we may consider numbers k such that some integer Y >= 1 forms the first digit(s) of X^k. For such numbers k the following inequality holds: log_B(Y) - floor(log_B(Y)) <= k*log_B(X) - floor(k*log_B(X)) < log_B(Y+1) - floor(log_B(Y+1)). The irrationality of log_B(X) is the necessary condition; see the Links section. Examples in the OEIS: B = 10, X = 2; Y = 1 (A067497), Y = 2 (A067469), Y = 3 (A172404).
%H Seiichi Manyama, <a href="/A363060/b363060.txt">Table of n, a(n) for n = 1..10000</a>
%H P. Bohl, <a href="http://eudml.org/doc/149304">Über ein in der Theorie der säkularen Störungen vorkommendes Problem</a>, J. Reine Angew. Math. 135 (1909), 189-283.
%H Luboš Pick, <a href="https://dml.cz/handle/10338.dmlcz/150396">On One Application of Irrationality in Search of the Seventh Heaven</a>, Pokroky matematiky, fyziky a astronomie, vol. 67 (2022), 37-44.
%H Hermann Weyl, <a href="https://doi.org/10.1007/BF03014883">Über die gibbs’sche Erscheinung und verwandte Konvergenzphänomene</a>, Rend. Circ. Matem. Palermo 30 (1910), 377-407.
%H Hermann Weyl, <a href="http://eudml.org/doc/158730">Über die Gleichverteilung von Zahlen mod. Eins.</a>, Mathematische Annalen 77 (1916), 313-352.
%e k = 9: the first digit of 2^9 = 512 is 5, thus k = 9 is a term.
%p R:= NULL: count:= 0: t:= 1:
%p for k from 1 while count < 100 do
%p t:= 2*t;
%p if floor(t/10^ilog10(t)) = 5 then R:= R,k; count:= count+1 fi
%p od:
%p R; # _Robert Israel_, May 19 2023
%t Select[Range[700], IntegerDigits[2^#][[1]] == 5 &] (* _Amiram Eldar_, May 16 2023 *)
%o (PARI) isok(k) = digits(2^k)[1] == 5; \\ _Michel Marcus_, May 16 2023
%o (Python)
%o from itertools import count, islice
%o def A363060_gen(startvalue=1): # generator of terms >= startvalue
%o m = 1<<(k:=max(startvalue,1))
%o for i in count(k):
%o if str(m)[0]=='5':
%o yield i
%o m <<= 1
%o A363060_list = list(islice(A363060_gen(),20)) # _Chai Wah Wu_, May 21 2023
%Y Cf. A000079, A008952, A018856.
%Y Cf. A067497, A067469, A172404, A367294, A367295, A330243, A367296, A097415.
%K nonn,base,easy
%O 1,1
%A _Ctibor O. Zizka_, May 16 2023