OFFSET
1,2
COMMENTS
A permutation of the positive integers.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 1 is the least positive integer, it has no other requirement to satisfy.
a(2) = 2 is the least positive integer > a(1) = 1, and a(2)*a(1) = 2 has a digit 2.
a(3) = 6 is the least positive integer > a(2) = 2 such that a(3)*a(2) (= 12) has a digit 2: The smaller choices 3, 4 or 5 do not satisfy this.
a(4) = 4 is the least positive integer > a(2) = 2 such that a(4)*a(3) (= 24) has a digit 2: The smaller choice 3 yields 3*6 = 18 and does not satisfy this.
Now, the least available positive integer a(5) = 3 is such that 3*4 = 12, which has again a digit 2. And so on.
MAPLE
N:= 100: # to get a(1)..a(n) where a(n+1) > N
S:= [$2..N]: nS:= N-1:
R:= 1: x:= 1; found:= true;
while found do
found:= false;
for i from 1 to nS do
if member(2, convert(S[i]*x, base, 10)) then
found:= true;
x:= S[i];
R:= R, x;
S:= subsop(i=NULL, S);
nS:= nS-1;
break
fi
od
od:
R; # Robert Israel, Feb 12 2023
PROG
(PARI) a(n, f=1, d=2, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a*k)), d)&&(a=k)&&break); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1])); a}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Feb 22 2018
STATUS
approved