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.

This page as a plain text file.
%I A245682 #28 May 22 2025 10:21:39
%S A245682 123876,142857,153846,230769,285714,1028574,1218753,1238760,1239876,
%T A245682 1246878,1294857,1402857,1420785,1425897,1428507,1428570,1428597,
%U A245682 1428705,1429857,1485792,1492857,1538460,1539846,1570284,1584297,2300769,2307690,2307699,2309769,2857014,2857140,2859714,2985714,10028574,10178649
%N A245682 Numbers x whose digits can be permuted to produce more than a single multiple of x.
%C A245682 It is a subset of A245680.
%C A245682 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
%H A245682 Paolo P. Lava, <a href="/A245682/b245682.txt">Table of n, a(n) for n = 1..200</a>
%e A245682 Two permutations of 123876 are 371628, 867132  and  371628 / 123876 = 3, 867132  / 123876 = 7.
%e A245682 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.
%p A245682 P:=proc(q) local a,b,c,i,j,k,n,t; for n from 1 to q do a:=n; b:=[];
%p A245682 while a>0 do b:=[a mod 10,op(b)]; a:=trunc(a/10); od;
%p A245682 t:=0; for i from 2 to 9 do a:=i*n; c:=[];
%p A245682 while a>0 do c:=[a mod 10,op(c)]; a:=trunc(a/10); od;
%p A245682 if sort(b)=sort(c) then t:=t+1; fi; if t>1 then print(n); break;
%p A245682 fi; od; od; end: P(10^10);
%p A245682 # Alternative
%p A245682 N:= 10: # get a(1) to a(N)
%p A245682 count:= 0:
%p A245682 for x from 10 while count < N do
%p A245682   M:= 10^(ilog10(x)+1)-1;
%p A245682   L:= sort(convert(x,base,10));
%p A245682   mults:= 0;
%p A245682   for i from 2 to floor(M/x) do
%p A245682     Lp:= sort(convert(i*x,base,10));
%p A245682     if Lp = L then
%p A245682       mults:= mults+1;
%p A245682       if mults = 2 then
%p A245682         count:= count+1;
%p A245682         A[count]:= x;
%p A245682         print(x);
%p A245682         break;
%p A245682       fi
%p A245682     fi
%p A245682    od
%p A245682 od:
%p A245682 seq(A[i],i=1..count); # _Robert Israel_, Jul 29 2014
%o A245682 (Python)
%o A245682 import itertools
%o A245682 from itertools import permutations
%o A245682 for n in range(1,10**8):
%o A245682   plist = list(permutations(str(n)))
%o A245682   count = 0
%o A245682   lst = []
%o A245682   for i in plist:
%o A245682     num = ''
%o A245682     for j in range(len(i)):
%o A245682       num += i[j]
%o A245682     if int(num)%n==0 and int(num)/n > 1:
%o A245682       if int(num) not in lst:
%o A245682         lst.append(int(num))
%o A245682         count += 1
%o A245682   if count > 1:
%o A245682     print(n,end=', ') # _Derek Orr_, Jul 29 2014
%o A245682 (PARI)
%o A245682 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
%Y A245682 Cf. A008919, A096092, A096093, A245680.
%K A245682 nonn,base
%O A245682 1,1
%A A245682 _Paolo P. Lava_, Jul 29 2014
%E A245682 a(7) to a(10) from _Robert Israel_, Jul 29 2014
%E A245682 a(11) - a(35) from _Derek Orr_, Jul 29 2014