login
Smallest positive integer not occurring earlier having no common digits with n in its decimal representation.
3

%I #16 Jan 29 2025 12:42:29

%S 2,1,4,3,6,5,8,7,10,9,20,30,22,23,24,25,26,27,28,11,33,13,14,15,16,17,

%T 18,19,31,12,29,40,21,50,41,42,44,45,46,32,35,36,51,37,38,39,52,53,55,

%U 34,43,47,48,60,49,70,61,62,63,54,57,58,59,71,72,73,80,74,75,56,64,65

%N Smallest positive integer not occurring earlier having no common digits with n in its decimal representation.

%C For n=1023456789 there is no possible a(n), so the sequence is finite. - _Eric Angelini_, Dec 18 2006

%C a(123456788) is the last term. - _Andrew Weimholt_, Dec 19 2006

%C a(123456788) = 9099900999090090. - Sasha Semenov, Dec 25 2006

%H R. Zumkeller, <a href="/A096779/b096779.txt">Table of n, a(n) for n = 1..10000</a>

%H Hans Havermann, <a href="/A096779/a096779.jpg">Graph of first 2600 terms</a>

%H Sasha Semenov, <a href="/A096779/a096779.txt">Notes on computing this sequence</a> [From rec.math]

%o (PARI) A096779_upto(N, U=[0])=vector(N, n, n=Set(digits(n)); for(k=1+U[1], oo, setsearch(U,k)|| setintersect(n,Set(digits(k)))|| [n=k, break]); U=setunion(U,[n]); while(#U>1&& U[2]==U[1]+1, U=U[^1]); n)/*+print(U)*/ \\ _M. F. Hasler_, Jan 29 2025

%K nonn,base,fini,look

%O 1,1

%A _Reinhard Zumkeller_, Aug 16 2004