OFFSET
0,1
COMMENTS
Such an N always exists since 10^(1 + number of digits of n) satisfies the property.
a(n) = 1 for almost all n (in the sense of natural density). - Charles R Greathouse IV, Nov 15 2022
What is the largest number in this sequence? It is somewhere between a(9911111111) = 302345678 and 203456789111111111. - Charles R Greathouse IV, Dec 09 2022
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
a(n) <= 10^(1 + number of digits of n).
a(n) <= 203456789111111111 < 2.04 * 10^17. (This can probably be improved by a few orders of magnitude.) - Charles R Greathouse IV, Nov 15 2022
MAPLE
digs:= proc(n) option remember;
local t;
t:= n mod 10;
if n < 10 then {t}
else {t} union procname((n-t)/10)
fi;
end proc:
f:= proc(n)
local k, Ln;
Ln:= digs(n);
for k from 1 do
if Ln union digs(k) = digs(n+k) then return k fi
od
end proc:
seq(f(n), n=0..100); # Robert Israel, Jan 03 2016
PROG
(PARI) a(n, d=digits(n), L=10^(1+#d))=for(k=1, L, Set(digits(k+n))==Set(concat(d, digits(k)))&&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(60)]) # Michael S. Branicky, Nov 15 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jan 01 2016
STATUS
approved