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.

A035059 Numbers k such that 2^k does not contain the digit 4 (probably finite).

Original entry on oeis.org

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

Views

Author

Patrick De Geest, Nov 15 1998

Keywords

Comments

a(25) > 2*10^9 if it exists. - Jon E. Schoenfield and Michael S. Branicky, Aug 02 2021

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