OFFSET
0,3
COMMENTS
Apparently the rules demand that a(n)>a(n-1) and that the "common" digit between a(n) and a(n-1) must appear only once in a(n). [Otherwise after 107 would follow 111.] - R. J. Mathar, May 05 2023
LINKS
R. J. Mathar, Table of n, a(n) for n = 0..73
EXAMPLE
a(8)=52 and a(9)=53. a(10) cannot be any in the range 54..59 because these share the digit 5 with a(8) and a(9). a(10) cannot be in the range 60..62 because these do not have a common digit with 53. So a(10)=63. - R. J. Mathar, May 05 2023
MAPLE
freq := proc(L, n)
local a;
a := 0 ;
for i from 1 to nops(L) do
if op(i, L) = n then
a := a+1 ;
end if ;
end do:
a ;
end proc:
A107277 := proc(n)
option remember ;
local a, dgsa, pre, pre2, dgspre, dgspre2, cdig;
if n <= 1 then
n ;
elif n =2 then
12 ;
else
for a from procname(n-1)+1 do
dgsa := convert(convert(a, base, 10), set) ;
pre2 := procname(n-2) ;
dgspre2 := convert(convert(pre2, base, 10), set) ;
if dgspre2 intersect dgsa = {} then
pre := procname(n-1) ;
dgspre := convert(convert(pre, base, 10), set) ;
cdig := dgsa intersect dgspre ;
if nops(cdig) = 1 then
dgsa := convert(a, base, 10) ;
if freq(dgsa, op(cdig)) = 1 then
return a;
end if;
end if;
end if ;
end do:
end if;
end proc:
seq(A107277(n), n=0..60) ; # R. J. Mathar, May 05 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, May 19 2005
STATUS
approved