login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A243977 a(n) is the largest run of identical digits that n^k can end with for some k, or 0 if there is no limit to such runs. 3
3, 1, 2, 1, 1, 1, 3, 1, 0, 2, 3, 3, 2, 1, 1, 5, 1, 2, 0, 1, 3, 1, 1, 1, 1, 1, 3, 1, 0, 3, 1, 4, 2, 1, 1, 3, 3, 3, 0, 1, 3, 1, 2, 1, 1, 1, 3, 1, 0, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

COMMENTS

a(10*n) = 0 for all n > 0.

a(54) > 30 or 0. The sequence continues for 54 < n < 100 {2, 2, 1, 1, 3, 2, 0, 1, 3, 1, 2, 1, 2, 1, 1, 1, 0, ?, 3, 3, 1, 1, 1, ?, 3, 4, 0, 1, 1, 1, 2, 1, 1, 1, 3, 1, 0, 2, 3, 1, 2, 1, 1, 4, 3, 2} where the question marks represent a(71) and a(77). a(71) > 44 or 0 and a(77) > 16 or 0.

a(53), a(71) and a(77) are conjectured to be infinite. See A244187.

LINKS

Table of n, a(n) for n=2..52.

EXAMPLE

For a(1), 2^k ends in 1 identical digit when k = 1, 2 identical digits when k = 18, and 3 identical digits when k = 39. 2^k doesn't end in 4 identical digits for any k. Thus a(1) = 3.

PROG

(PARI) a(n, p)=lst=[]; for(c=0, 10^p, m=n^c%10^p; if(vecsearch(vecsort(lst), m), for(i=1, #lst, if(vecextract(lst, 2^(i-1), )==[m], return([c, c-i+1])))); if(!vecsearch(vecsort(lst), m), lst=concat(lst, m)))

hup(n)=if(n%10==0, return(0)); ww=[]; p=2; for(ii=1, a(n, p)[1], ww=concat(ww, ii)); while(p<100, v=ww; w=[]; for(q=1, #v, h=digits(n^v[q]%10^p); if(#h==p&&(vecmin(h)==vecmax(h)), w=concat(w, v[q]))); if(w, ww=[]; for(k=1, #w, j=w[k]; while(j<=a(n, p+1)[1], ww=concat(ww, j); j+=a(n, p)[2])); ww=vecsort(ww, , 8); p++); if(!w, return(p-1)))

n=2; while(n<100, print1(hup(n), ", "); n++)

(Python)

def a(n, p):

..lst = []

..for c in range(10**p+1):

....m = n**c%10**p

....if m in lst:

......return [c, c-lst.index(m)]

....else:

......lst.append(m)

def cou(n):

..if n % 10 == 0:

....return 0

..ww = []

..p = 2

..aa = a(n, p)[0]

..ww.extend(range(aa))

..while p < 100:

....newlst = ww

....w = []

....for i in newlst:

......m = n**i%10**p

......if len(str(m))==p and m%int('1'*p)==0:

........w.append(i)

....if w:

......ww = []

......for k in w:

........j = k

........while j <= a(n, p+1)[0]:

..........ww.append(j)

..........j += a(n, p)[1]

......ww.sort()

......p += 1

....else:

......return p-1

n = 2

while n < 100:

..if cou(n):

....print(cou(n), end=', ')

..else:

....print(0, end=', ')

..n += 1

CROSSREFS

Cf. A243912, A243911, A244187.

Sequence in context: A086249 A176784 A176511 * A016569 A072801 A098872

Adjacent sequences:  A243974 A243975 A243976 * A243978 A243979 A243980

KEYWORD

nonn,base

AUTHOR

Derek Orr, Jun 16 2014

EXTENSIONS

Programs corrected and improved by Derek Orr, Aug 18 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 16 10:36 EDT 2019. Contains 327094 sequences. (Running on oeis4.)