login
a(n) is the smallest m for which 7^m contains n consecutive identical digits.
14

%I #45 Nov 09 2024 14:38:54

%S 0,6,31,71,172,175,1961,6176,33836,61282,305871,856635,2135396,

%T 7291510,11032874,30775389

%N a(n) is the smallest m for which 7^m contains n consecutive identical digits.

%C a(13) > 1116000. - _Chai Wah Wu_, Dec 17 2014

%C a(14) > 7*10^6. - _Giovanni Resta_, Apr 20 2016

%e 7^31 = 157775382034845806615042743 contains 3 consecutive identical digits.

%o (Python)

%o import sys

%o sys.set_int_max_str_digits(200000)

%o def a(n):

%o st = "0123456789"

%o for k in range(10**6):

%o s = str(7**k)

%o tot = 0

%o for i in st:

%o if s.count(i*n) > 0:

%o tot += 1

%o break

%o if tot > 0:

%o return k

%o n = 1

%o while n < 10:

%o print(a(n), end=', ')

%o n += 1

%o # _Derek Orr_, Jul 28 2014

%o (Python)

%o def A215730(n):

%o l, x = [str(d)*n for d in range(10)], 1

%o for m in range(10**9):

%o s = str(x)

%o for k in l:

%o if k in s:

%o return m

%o x *= 7

%o return 'search limit reached'

%o # _Chai Wah Wu_, Dec 17 2014

%Y Cf. A215736, A045875.

%K nonn,base,hard,changed

%O 1,2

%A _V. Raman_, Aug 22 2012

%E Added a(10), _Rick van der Hoorn_, Mar 26 2013

%E a(11)-a(12) from _Hiroaki Yamanouchi_, Aug 29 2014

%E a(13) from _Giovanni Resta_, Apr 19 2016

%E a(14)-a(15) from _Bert Dobbelaere_, Feb 15 2019

%E a(16) from _Paul Geneau de Lamarlière_, Jul 16 2024