This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A243977 #23 May 22 2025 10:21:38 %S A243977 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, %T A243977 1,3,3,3,0,1,3,1,2,1,1,1,3,1,0,1,3 %N 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. %C A243977 a(10*n) = 0 for all n > 0. %C A243977 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. %C A243977 a(53), a(71) and a(77) are conjectured to be infinite. See A244187. %e A243977 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. %o A243977 (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))) %o A243977 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))) %o A243977 n=2;while(n<100,print1(hup(n),", ");n++) %o A243977 (Python) %o A243977 def a(n,p): %o A243977 lst = [] %o A243977 for c in range(10**p+1): %o A243977 m = n**c%10**p %o A243977 if m in lst: %o A243977 return [c,c-lst.index(m)] %o A243977 else: %o A243977 lst.append(m) %o A243977 def cou(n): %o A243977 if n % 10 == 0: %o A243977 return 0 %o A243977 ww = [] %o A243977 p = 2 %o A243977 aa = a(n,p)[0] %o A243977 ww.extend(range(aa)) %o A243977 while p < 100: %o A243977 newlst = ww %o A243977 w = [] %o A243977 for i in newlst: %o A243977 m = n**i%10**p %o A243977 if len(str(m))==p and m%int('1'*p)==0: %o A243977 w.append(i) %o A243977 if w: %o A243977 ww = [] %o A243977 for k in w: %o A243977 j = k %o A243977 while j <= a(n,p+1)[0]: %o A243977 ww.append(j) %o A243977 j += a(n,p)[1] %o A243977 ww.sort() %o A243977 p += 1 %o A243977 else: %o A243977 return p-1 %o A243977 n = 2 %o A243977 while n < 100: %o A243977 if cou(n): %o A243977 print(cou(n),end=', ') %o A243977 else: %o A243977 print(0,end=', ') %o A243977 n += 1 %Y A243977 Cf. A243912, A243911, A244187. %K A243977 nonn,base %O A243977 2,1 %A A243977 _Derek Orr_, Jun 16 2014 %E A243977 Programs corrected and improved by _Derek Orr_, Aug 18 2014