login
a(n) is the least value of k such that the decimal expansion of n^k contains two consecutive identical digits.
7

%I #30 Feb 26 2024 19:38:37

%S 16,11,8,11,5,6,6,6,2,1,2,9,3,2,4,7,5,5,2,2,1,6,4,6,5,4,8,5,2,6,5,1,2,

%T 2,3,7,2,4,2,5,3,4,1,3,2,2,3,3,2,7,4,3,6,1,4,4,2,4,2,3,2,3,3,2,1,2,3,

%U 4,2,3,7,6,3,6,2,1,3,4,2,3,3,2,5,2,4,6

%N a(n) is the least value of k such that the decimal expansion of n^k contains two consecutive identical digits.

%C Least number m such that n^m is a term of A171901 - _Chai Wah Wu_, Feb 20 2019

%C Conjecture: 1 <= a(n) <= 16 for n > 1 and a(n) < 16 for n > 2. - _Chai Wah Wu_, Feb 20 2019

%C a(n) >= 1 for all n > 1 and is bounded: see link for proof. - _Robert Israel_, Feb 21 2019

%H V. Raman, <a href="/A217157/b217157.txt">Table of n, a(n) for n = 2..10000</a>

%H Robert Israel, <a href="/A217157/a217157.pdf">Proof that A217157 >= 1 and is bounded</a>

%F a(A171901(n)) = 1. - _Chai Wah Wu_, Feb 20 2019

%F a(n) = A215236(n) + 1. - _Georg Fischer_, Nov 25 2020

%p f:= proc(n) local L,k;

%p for k from 1 do

%p L:= convert(n^k,base,10);

%p if has(L[2..-1]-L[1..-2],0) then return k fi

%p od

%p end proc:

%p map(f, [$2..100]); # _Robert Israel_, Feb 21 2019

%t Table[k = 1; While[! MemberQ[Differences[IntegerDigits[n^k]], 0], k++]; k, {n, 2, 100}] (* _T. D. Noe_, Oct 01 2012 *)

%o (Python)

%o def A217157(n):

%o m, k = 1, n

%o while True:

%o s = str(k)

%o for i in range(1,len(s)):

%o if s[i] == s[i-1]:

%o return m

%o m += 1

%o k *= n # _Chai Wah Wu_, Feb 20 2019

%Y Cf. A045875, A215236.

%Y Cf. A215727, A215728, A215729, A215730, A215731, A171901, A306305.

%K nonn,base

%O 2,1

%A _V. Raman_, Sep 27 2012