cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

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
Offset: 2

Views

Author

Derek Orr, Jun 16 2014

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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

Extensions

Programs corrected and improved by Derek Orr, Aug 18 2014

A244188 Numbers n such that the digit that repeats the most at the end of n^k for some k is not the last digit of n.

Original entry on oeis.org

2, 12, 22, 33, 37, 42, 52, 62, 72, 73, 77, 92, 102, 112, 113, 117, 122, 142, 152, 153, 162, 172, 192, 197, 202, 212, 222, 233, 237, 242, 252, 262, 272, 273, 277, 292, 302, 312, 313, 317, 322, 342, 352, 353, 362, 372, 392, 397, 402, 412, 422, 433, 437, 442, 452, 462, 472
Offset: 1

Views

Author

Derek Orr, Jun 22 2014

Keywords

Comments

a(n) ends in either a 2, 3, or 7.
If a(n) ends in a 2, the digit that repeats itself the most at the end of a(n)^k is 8.
If a(n) ends in a 3, the digit that repeats itself the most at the end of a(n)^k is 7.
If a(n) ends in a 7, the digit that repeats itself the most at the end of a(n)^k is 3.
The numbers that end in 2 are congruent to {2, 12, 22, 42} mod 50.
The numbers that end in 3 are congruent to {33, 73, 113, 153} mod 200.
The numbers that end in 7 are congruent to {37, 77, 117, 197} mod 200.

Examples

			2^k ends in 2 of the same digit for k = 18 mod 20 (last digit is 4) and 19 mod 20 (last digit is 8). 2^k ends in 3 of the same digit for k = 39 mod 100 (last digit is 8). Since 8 is the only possibility, 8 must remain the only possibility for any larger run of identical digits. Since 8 is not the last digit of 2, then 2 is a member of this sequence.
33^k ends in 2 of the same digit for k = 1 mod 20 (last digit is 3) and 7 mod 20 (last digit is 7). 33^k ends in 3 of the same digit for k = 87 mod 100 (last digit is 7). Since 7 is the only possibility, 7 must remain the only possibility for any larger run of identical digits. Since 7 is not the last digit of 33, 33 is a member of this sequence.
		

Crossrefs

Programs

  • PARI
    seq(n)=for(m=2,6,cc=0;for(i=10^(m-1),10^m,st1=(n^i)%10^m;b="";for(j=1,m,b=concat(b,"1"));if(st1%eval(b)==0,for(d=i+1,10^m,sb1=(n^d)%10^m;if(sb1%eval(b)==0,if(sb1%10==st1%10,return(st1%10));if(sb1%10!=st1%10,cc++;break)))));if(cc==0,return(n%10)))
    n=1;while(n<1000,if(seq(n)!=n%10,print1(n,", "));n++)
Showing 1-2 of 2 results.