%I #22 Mar 08 2024 16:02:58
%S 0,1,2,3,4,8,11,13,14,15,26
%N Numbers k such that the decimal expansion of 6^k contains no pair of consecutive equal digits (probably finite).
%C No additional terms up to 25000. - _Harvey P. Dale_, Oct 17 2011
%C No additional terms up to 100000. - _Michel Marcus_, Oct 16 2019
%C No additional terms up to 10^7. - _Lucas A. Brown_, Mar 02 2024
%e 6^26 = 170581728179578208256 where no consecutive digits are equal.
%t Select[Range[120],!MemberQ[Differences[IntegerDigits[6^#]],0]&] (* _Harvey P. Dale_, Oct 17 2011 *)
%o (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
%o (Python)
%o try: from gmpy2 import mpz; x = mpz(1)
%o except: x = 1
%o print(0)
%o k = 1
%o while True:
%o print('\b'*42 + str(k), end='')
%o x *= 6 # x == 6**k
%o y, flag = x, True
%o y, a = divmod(y, 10)
%o while y > 6:
%o b = a
%o y, a = divmod(y, 10)
%o if a == b:
%o flag = False
%o break
%o if flag: print()
%o k += 1
%o # _Lucas A. Brown_, Mar 02 2024
%Y Cf. A000400, A030702, A046264, A046272.
%K nonn,base,more
%O 1,3
%A _Patrick De Geest_, Sep 15 1999
|