A035059 Numbers k such that 2^k does not contain the digit 4 (probably finite).
0, 1, 3, 4, 5, 7, 8, 9, 13, 15, 16, 17, 21, 23, 24, 29, 40, 41, 43, 55, 69, 75, 85, 107
Offset: 1
Crossrefs
Cf. similar sequences listed in A035064.
Programs
-
Magma
[n: n in [0..1000] | not 4 in Intseq(2^n) ]; // Vincenzo Librandi, May 07 2015
-
Mathematica
Join[{0}, Select[Range@10000, FreeQ[IntegerDigits[2^#], 4] &]] (* Vincenzo Librandi, May 07 2015 *)
-
Python
N = 200; modder = 10**N; REPORT = 10**5 def ok(s): return '4' not in s def ok1(n): return ok(str(pow(2, n, modder))) def afind(limit, startk=0, verbose=False): full_tests = 0 for k in range(startk, limit): if ok1(k): full_tests += 1 if ok(str(pow(2, k))): print(k, end=", ") if verbose and k and k%REPORT == 0: print("[ ...", k, full_tests, "]") k += 1 afind(10**6, verbose=True) # Michael S. Branicky, Aug 02 2021
Extensions
Initial 0 inserted by Vincenzo Librandi, May 07 2015
Comments