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.
%I A172404 #35 Nov 13 2023 10:01:39 %S A172404 5,15,25,35,45,55,65,75,78,85,88,95,98,108,118,128,138,148,158,168, %T A172404 178,181,188,191,201,211,221,231,241,251,261,271,274,281,284,291,294, %U A172404 304,314,324,334,344,354,364,367,374,377,384,387,397,407,417,427,437,447,457,467,470,477,480,487,490,500 %N A172404 Numbers k such that 3 is the first digit of 2^k. %C A172404 The asymptotic density of this sequence is log_10(4/3) = 0.124938... - _Amiram Eldar_, Jan 27 2021 %H A172404 Seiichi Manyama, <a href="/A172404/b172404.txt">Table of n, a(n) for n = 1..10000</a> (first 4200 terms from Muniru A Asiru) %p A172404 x := 1.; L := []; for n from 0 to 500 do if 3 < x and x < 4 then L := [op(L), n] end if; x := 2*x; if x > 10 then x := (1/10)*x end if end do; L; %t A172404 Select[Range[1000], IntegerDigits[2^#][[1]] == 3 &] %o A172404 (Python) %o A172404 ans, x = [], 1. %o A172404 for n in range(501): %o A172404 if 3 < x < 4: ans.append(n) %o A172404 x = x*2 %o A172404 if x > 10: x = x / 10 %o A172404 print(ans) %o A172404 (Python) %o A172404 from itertools import islice %o A172404 def A172404_gen(): # generator of terms %o A172404 a, b, c, l = 3, 4, 1, 0 %o A172404 while True: %o A172404 if a<=c: %o A172404 if c<b: %o A172404 yield l %o A172404 a *= 10 %o A172404 b *= 10 %o A172404 c <<= 1 %o A172404 l += 1 %o A172404 A172404_list = list(islice(A172404_gen(),30)) # _Chai Wah Wu_, Nov 13 2023 %o A172404 (GAP) Filtered([1..500],n->ListOfDigits(2^n)[1]=3); # _Muniru A Asiru_, Oct 17 2018 %o A172404 (PARI) isok(n) = digits(2^n)[1] == 3; \\ _Michel Marcus_, Oct 18 2018 %Y A172404 Cf. A000079. %Y A172404 Cf. A067497, A067469, A367294, A363060, A367295, A330243, A367296, A097415. %K A172404 nonn,base,easy %O A172404 1,1 %A A172404 _David Radcliffe_, Nov 20 2010