%I #34 Sep 08 2022 08:44:52
%S 0,1,3,4,5,7,8,9,13,15,16,17,21,23,24,29,40,41,43,55,69,75,85,107
%N Numbers k such that 2^k does not contain the digit 4 (probably finite).
%C a(25) > 2*10^9 if it exists. - _Jon E. Schoenfield_ and _Michael S. Branicky_, Aug 02 2021
%t Join[{0}, Select[Range@10000, FreeQ[IntegerDigits[2^#], 4] &]] (* _Vincenzo Librandi_, May 07 2015 *)
%o (Magma) [n: n in [0..1000] | not 4 in Intseq(2^n) ]; // _Vincenzo Librandi_, May 07 2015
%o (Python)
%o N = 200; modder = 10**N; REPORT = 10**5
%o def ok(s): return '4' not in s
%o def ok1(n): return ok(str(pow(2, n, modder)))
%o def afind(limit, startk=0, verbose=False):
%o full_tests = 0
%o for k in range(startk, limit):
%o if ok1(k):
%o full_tests += 1
%o if ok(str(pow(2, k))): print(k, end=", ")
%o if verbose and k and k%REPORT == 0:
%o print("[ ...", k, full_tests, "]")
%o k += 1
%o afind(10**6, verbose=True) # _Michael S. Branicky_, Aug 02 2021
%Y Cf. similar sequences listed in A035064.
%K nonn,base,more
%O 1,3
%A _Patrick De Geest_, Nov 15 1998
%E Initial 0 inserted by _Vincenzo Librandi_, May 07 2015
|