login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A245682 Numbers x whose digits can be permuted to produce more than a single multiple of x. 4

%I #26 Aug 08 2014 18:24:54

%S 123876,142857,153846,230769,285714,1028574,1218753,1238760,1239876,

%T 1246878,1294857,1402857,1420785,1425897,1428507,1428570,1428597,

%U 1428705,1429857,1485792,1492857,1538460,1539846,1570284,1584297,2300769,2307690,2307699,2309769,2857014,2857140,2859714,2985714,10028574,10178649

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

%C It is a subset of A245680.

%C 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 Paolo P. Lava, <a href="/A245682/b245682.txt">Table of n, a(n) for n = 1..200</a>

%e Two permutations of 123876 are 371628, 867132 and 371628 / 123876 = 3, 867132 / 123876 = 7.

%e 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 P:=proc(q) local a,b,c,i,j,k,n,t; for n from 1 to q do a:=n; b:=[];

%p while a>0 do b:=[a mod 10,op(b)]; a:=trunc(a/10); od;

%p t:=0; for i from 2 to 9 do a:=i*n; c:=[];

%p while a>0 do c:=[a mod 10,op(c)]; a:=trunc(a/10); od;

%p if sort(b)=sort(c) then t:=t+1; fi; if t>1 then print(n); break;

%p fi; od; od; end: P(10^10);

%p # Alternative

%p N:= 10: # get a(1) to a(N)

%p count:= 0:

%p for x from 10 while count < N do

%p M:= 10^(ilog10(x)+1)-1;

%p L:= sort(convert(x,base,10));

%p mults:= 0;

%p for i from 2 to floor(M/x) do

%p Lp:= sort(convert(i*x,base,10));

%p if Lp = L then

%p mults:= mults+1;

%p if mults = 2 then

%p count:= count+1;

%p A[count]:= x;

%p print(x);

%p break;

%p fi

%p fi

%p od

%p od:

%p seq(A[i],i=1..count); # _Robert Israel_, Jul 29 2014

%o (Python)

%o import itertools

%o from itertools import permutations

%o for n in range(1,10**8):

%o ..plist = list(permutations(str(n)))

%o ..count = 0

%o ..lst = []

%o ..for i in plist:

%o ....num = ''

%o ....for j in range(len(i)):

%o ......num += i[j]

%o ....if int(num)%n==0 and int(num)/n > 1:

%o ......if int(num) not in lst:

%o ........lst.append(int(num))

%o ........count += 1

%o ..if count > 1:

%o ....print(n,end=', ') # _Derek Orr_, Jul 29 2014

%o (PARI)

%o 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 Cf. A008919, A096092, A096093, A245680.

%K nonn,base

%O 1,1

%A _Paolo P. Lava_, Jul 29 2014

%E a(7) to a(10) from _Robert Israel_, Jul 29 2014

%E a(11) - a(35) from _Derek Orr_, Jul 29 2014

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 10 05:30 EDT 2024. Contains 374196 sequences. (Running on oeis4.)