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.

A245682 Numbers x whose digits can be permuted to produce more than a single multiple of x.

Original entry on oeis.org

123876, 142857, 153846, 230769, 285714, 1028574, 1218753, 1238760, 1239876, 1246878, 1294857, 1402857, 1420785, 1425897, 1428507, 1428570, 1428597, 1428705, 1429857, 1485792, 1492857, 1538460, 1539846, 1570284, 1584297, 2300769, 2307690, 2307699, 2309769, 2857014, 2857140, 2859714, 2985714, 10028574, 10178649
Offset: 1

Views

Author

Paolo P. Lava, Jul 29 2014

Keywords

Comments

It is a subset of A245680.
If x < 10^d is in the sequence, then so are x*10^j*(1+10^d+...+10^k*d) for all nonnegative integers j and k. - Robert Israel, Jul 29 2014

Examples

			Two permutations of 123876 are 371628, 867132  and  371628 / 123876 = 3, 867132  / 123876 = 7.
Five permutations of 142857 are 285714, 428571, 571428, 714285, 857142 and 285714 / 142857 = 2, 428571 / 142857 = 3, 571428 / 142857 = 4, 714285 / 142857 = 5, 857142 / 142857 = 6.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,c,i,j,k,n,t; for n from 1 to q do a:=n; b:=[];
    while a>0 do b:=[a mod 10,op(b)]; a:=trunc(a/10); od;
    t:=0; for i from 2 to 9 do a:=i*n; c:=[];
    while a>0 do c:=[a mod 10,op(c)]; a:=trunc(a/10); od;
    if sort(b)=sort(c) then t:=t+1; fi; if t>1 then print(n); break;
    fi; od; od; end: P(10^10);
    # Alternative
    N:= 10: # get a(1) to a(N)
    count:= 0:
    for x from 10 while count < N do
      M:= 10^(ilog10(x)+1)-1;
      L:= sort(convert(x,base,10));
      mults:= 0;
      for i from 2 to floor(M/x) do
        Lp:= sort(convert(i*x,base,10));
        if Lp = L then
          mults:= mults+1;
          if mults = 2 then
            count:= count+1;
            A[count]:= x;
            print(x);
            break;
          fi
        fi
       od
    od:
    seq(A[i],i=1..count); # Robert Israel, Jul 29 2014
  • PARI
    for(n=1,10^8,d=vecsort(digits(n));p=0;for(k=2,9,dd=vecsort(digits(n*k));if(d==dd,p++));if(p>1,print1(n,", "))) \\ faster program Derek Orr, Jul 29 2014
  • Python
    import itertools
    from itertools import permutations
    for n in range(1,10**8):
      plist = list(permutations(str(n)))
      count = 0
      lst = []
      for i in plist:
        num = ''
        for j in range(len(i)):
          num += i[j]
        if int(num)%n==0 and int(num)/n > 1:
          if int(num) not in lst:
            lst.append(int(num))
            count += 1
      if count > 1:
        print(n,end=', ') # Derek Orr, Jul 29 2014
    

Extensions

a(7) to a(10) from Robert Israel, Jul 29 2014
a(11) - a(35) from Derek Orr, Jul 29 2014