A050727 Numbers k such that the decimal expansion of 6^k contains no pair of consecutive equal digits (probably finite).
0, 1, 2, 3, 4, 8, 11, 13, 14, 15, 26
Offset: 1
Examples
6^26 = 170581728179578208256 where no consecutive digits are equal.
Programs
-
Mathematica
Select[Range[120],!MemberQ[Differences[IntegerDigits[6^#]],0]&] (* Harvey P. Dale, Oct 17 2011 *)
-
PARI
isok(n) = {my(d = digits(6^n), c = d[1]); for (i=2, #d, if (d[i] == c, return (0)); c = d[i];); return (1);} \\ Michel Marcus, Oct 16 2019
-
Python
try: from gmpy2 import mpz; x = mpz(1) except: x = 1 print(0) k = 1 while True: print('\b'*42 + str(k), end='') x *= 6 # x == 6**k y, flag = x, True y, a = divmod(y, 10) while y > 6: b = a y, a = divmod(y, 10) if a == b: flag = False break if flag: print() k += 1 # Lucas A. Brown, Mar 02 2024
Comments