login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A107277 If n <= 1 then n else smallest number having in decimal representation exactly one common digit with its predecessor but none with its pre-predecessor. 1
0, 1, 12, 20, 30, 31, 41, 42, 52, 53, 63, 64, 74, 75, 85, 86, 96, 97, 107, 122, 233, 300, 401, 422, 523, 560, 611, 712, 730, 804, 811, 912, 930, 3444, 4111, 5001, 5222, 6233, 6400, 7011, 7222, 8233, 8400, 9011, 9222, 23333, 30000, 40111, 42222, 52333, 56000 (list; graph; refs; listen; history; text; internal format)
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
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
Sequence in context: A364999 A366807 A210968 * A256883 A124672 A289980
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, May 19 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:18 EDT 2024. Contains 371967 sequences. (Running on oeis4.)