A266586 The least nonnegative integer N such that n*N has the same digits as n and N together, not counting repetitions.
1, 6163, 51, 416, 251, 21, 967, 86, 255, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1255, 1, 781, 973, 26, 265, 24, 81, 1139, 1135, 51, 1, 291, 186, 151, 41, 936, 3001, 886, 982, 416, 1, 341, 315, 1464, 181, 734, 371, 958, 1921, 251, 1, 2412, 635, 846, 221, 1801, 125, 948, 845, 21, 1, 251, 585, 2213, 281, 1076
Offset: 1
Examples
a(2) = 6163 since 2*6163 = 12326 has the same digits (1, 2, 3 and 6) as concat(2,6163) = 26163, and 6163 is the least N with this property.
Links
- M. F. Hasler, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local k,Ln,Lk,Lnk; Ln:= convert(convert(n,base,10),set); if has(Ln,1) then return 1 fi; for k from 2 do Lk:= convert(convert(k,base,10),set); Lnk:= convert(convert(n*k,base,10),set); if Lnk = Ln union Lk then return k fi od end proc: map(f, [$1..100]); # Robert Israel, Jan 01 2016
-
PARI
A266586(n,L=9e9,d=digits(n))=for(k=1,L,Set(digits(k*n))==Set(concat(digits(k),d))&&return(k))
-
Python
from itertools import count def a(n): digs = set(str(n)) return next(N for N in count(1) if digs | set(str(N)) == set(str(n*N))) print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Nov 15 2022
Comments