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.

Showing 1-3 of 3 results.

A004642 Powers of 2 written in base 3.

Original entry on oeis.org

1, 2, 11, 22, 121, 1012, 2101, 11202, 100111, 200222, 1101221, 2210212, 12121201, 102020102, 211110211, 1122221122, 10022220021, 20122210112, 111022121001, 222122012002, 1222021101011, 10221112202022, 21220002111121, 120210012000012, 1011120101000101, 2100010202000202
Offset: 0

Views

Author

Keywords

Comments

When n is odd, a(n) ends in 1, and when n is even, a(n) ends in 2, since 2^n is congruent to 1 mod 3 when n is odd and to 2 mod 3 when n is even. - Alonso del Arte Dec 11 2009
Sloane (1973) conjectured a(n) always has a 0 between the most and least significant digits if n > 15 (see A102483 and A346497).
Erdős (1978) conjectured that for n > 8 a(n) has at least one 2 (see link to Terry Tao's blog). - Dmitry Kamenetsky, Jan 10 2017

References

  • N. J. A. Sloane, The Persistence of a Number, J. Recr. Math. 6 (1973), 97-98.

Crossrefs

Cf. A000079: powers of 2 written in base 10.
Cf. A004643, ..., A004655: powers of 2 written in base 4, 5, ..., 16.
Cf. A004656, A004658, A004659, ..., A004663: powers of 3 written in base 2, 4, 5, ..., 9.

Programs

  • Magma
    [Seqint(Intseq(2^n, 3)): n in [0..30]]; // G. C. Greubel, Sep 10 2018
  • Mathematica
    Table[FromDigits[IntegerDigits[2^n, 3]], {n, 25}] (* Alonso del Arte Dec 11 2009 *)
  • PARI
    a(n)=fromdigits(digits(2^n,3)) \\ M. F. Hasler, Jun 23 2018
    

A102483 Numbers k such that 2^k contains no zeros in base 3.

Original entry on oeis.org

0, 1, 2, 3, 4, 15
Offset: 1

Views

Author

N. J. A. Sloane, Feb 25 2005

Keywords

Comments

I conjectured in 1973 that there are no further terms. This question is still open.
A104320(a(n)) = 0. - Reinhard Zumkeller, Mar 01 2005
No other terms less than 200000. - Robert G. Wilson v, Dec 06 2005
a(7) > 10^7. - Martin Ehrenstein, Jul 27 2021
If it exists, a(7) > 10^21. - Robert Saye, Mar 23 2022

Crossrefs

Programs

  • Mathematica
    Select[ Range@1000, FreeQ[ IntegerDigits[2^#, 3], 0] &] (* Robert G. Wilson v, Dec 06 2005 *)
  • PARI
    for (n=0, 100, if (vecmin(digits(2^n, 3)), print1(n, ", "))) \\ Michel Marcus, Mar 25 2015

A351927 Smallest positive integer k such that 2^k has no '0' in the last n digits of its ternary expansion.

Original entry on oeis.org

1, 2, 4, 10, 15, 15, 15, 15, 15, 15, 50, 50, 101, 101, 101, 101, 143, 143, 143, 143, 143, 143, 143, 143, 143, 1916, 1916, 1916, 1916, 1916, 1916, 82286, 1134022, 1639828, 3483159, 3483159, 3483159, 3917963, 3917963, 3917963, 4729774, 4729774, 9827775, 9827775, 43622201, 43622201, 43622201
Offset: 1

Views

Author

Robert Saye, Feb 25 2022

Keywords

Comments

The powers of two are required to have at least n ternary digits, i.e., 2^k >= 3^(n-1).
Sloane (1973) conjectured that every power 2^n with n > 15 has a '0' somewhere in its ternary expansion (see A102483 and A346497).

Crossrefs

Programs

  • Mathematica
    smallest[n_] := Module[{k}, k = Max[1, Ceiling[(n - 1) Log[2, 3]]];  While[MemberQ[Take[IntegerDigits[2^k, 3], -n], 0], ++k]; k]; Table[smallest[n], {n, 1, 20}]
  • PARI
    a(n) = my(k=1); while(!vecmin(Vec(Vecrev(digits(2^k,3)), n)), k++); k; \\ Michel Marcus, Feb 26 2022
    
  • Python
    from sympy.ntheory.digits import digits
    def a(n, startk=1):
        k = max(startk, len(bin(3**(n-1))[2:]))
        pow2 = 2**k
        while 0 in digits(pow2, 3)[-n:]:
            k += 1
            pow2 *= 2
        return k
    an = 0
    for n in range(1, 32):
        an = a(n, an)
        print(an, end=", ") # Michael S. Branicky, Mar 10 2022
    
  • Python
    from itertools import count
    def A351927(n):
        kmax, m = 3**n, (3**(n-1)).bit_length()
        k2 = pow(2,m,kmax)
        for k in count(m):
            a = k2
            if 3*a >= kmax:
                while a > 0:
                    a, b = divmod(a,3)
                    if b == 0:
                        break
                else:
                    return k
            k2 = 2*k2 % kmax # Chai Wah Wu, Mar 19 2022
Showing 1-3 of 3 results.