OFFSET
1,2
COMMENTS
The sequence starts with a(1) = 1 and is extended with the smallest integer not yet used that does not lead to a contradiction.
EXAMPLE
The blocks of terms including at least a digit "1" are indicated here by parentheses; the successive block-sizes are 1, 2, 3, 4, 5,... which reproduces the sequence itself: (1),2,3,4,5,6,7,8,9,(10,11),20,(12,13,14),22,(15,16,17,18),23,(19,21,31,41,51),24...
MAPLE
isA011531 := proc(n)
nops(convert(convert(n, base, 10), set) intersect {1}) > 0 ;
simplify(%) ;
end proc:
A011531_next := proc(n)
local a;
for a from n+1 do
if isA011531(a) then
return a;
end if;
end do:
end proc:
isA052383 := proc(n)
not isA011531(n) ;
end proc:
A052383_next := proc(n)
local a;
for a from n+1 do
if isA052383(a) then
return a;
end if;
end do:
end proc:
A275512grp1 := proc(a)
local idx1, n ;
idx1 := 0 ;
if isA052383(a) then
return 0;
end if;
for n from 1 do
if isA011531(A275512(n)) then
if n =1 then
idx1 := 1;
elif isA052383(A275512(n-1)) then
idx1 := idx1+1 ;
end if;
end if;
if A275512(n) = a then
return idx1 ;
end if;
end do:
end proc:
A275512 := proc(n)
option remember;
local a, aprev, prev1, grp1, d, seen, reqlen, npr;
if n =1 then
1;
else
for a from 2 do
seen := false;
for npr from 1 to n-1 do
if procname(npr) = a then
seen := true;
break;
end if;
end do:
if not seen then
aprev := procname(n-1) ;
if isA052383(aprev) then
return a;
else
prev1 := 0 ;
for d from 1 to n-1 do
if isA011531(procname(n-d)) then
prev1 := prev1+1 ;
else
break;
end if;
end do:
grp1 := A275512grp1(aprev) ;
reqlen := procname(grp1) ;
if reqlen > prev1 then
return A011531_next(aprev) ;
elif n-prev1-1 > 0 then
return A052383_next(procname(n-prev1-1)) ;
else
return 2 ;
end if;
end if;
end if;
end do;
end if;
end proc:
seq(A275512(n), n=1..100) ; # R. J. Mathar, Jul 31 2016
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Eric Angelini, Jul 31 2016
STATUS
approved