OFFSET
1,2
EXAMPLE
Considering a(9), having already 1,2,3,4,5,6,7,8, the next number must be 12 because after 1,2,3,4,5,6,7,8 we shall continue with a 1.
But 1 is already in the sequence so we need to add a 2 -> 12. And so on.
MAPLE
cyc8 := proc(n) op(n, [2, 3, 4, 5, 6, 7, 8, 1]) ; end:
A165306 := proc(n) option remember ; local k, prev, d, a ; if n = 1 then 1; else d := cyc8(procname(n-1) mod 10) ; a := d ; while true do prev := false; for k from 1 to n-1 do if procname(k) = a then prev := true; break; end if; end do; if not prev then return a; end if; d := cyc8(d) ; a := 10*a+d ; end do; end if ; end proc:
seq(A165306(n), n=1..60) ; # R. J. Mathar, Feb 02 2010
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Sep 14 2009
EXTENSIONS
Keyword base added by R. J. Mathar, Feb 02 2010
STATUS
approved