OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..8936, all terms < 10000
FORMULA
MAPLE
startsWith := proc(n, dig) local nshft ; nshft := n ; while nshft >= 10 do nshft := floor(nshft/10) ; od ; if dig = nshft then RETURN(true) ; else RETURN(false) ; fi ; end: A076654 := proc(nmax) local candid, a; a := [1] ; while nops(a) < nmax do candid := 2 ; while not startsWith(candid, op(-1, a) mod 10) or candid mod 10 = 0 or candid in a do candid := candid+1 ; od ; a := [op(a), candid] ; od ; RETURN(a) ; end: a := A076654(200) : for n from 1 to nops(a) do printf("%d, ", op(n, a)) ; od ; # R. J. Mathar, Nov 12 2006
PROG
(Haskell)
import Data.List (delete)
a076654 n = a076654_list !! (n-1)
a076654_list = f a067251_list 1 where
f xs z = g xs where
g (y:ys) = if a000030 y == mod z 10 then y : f (delete y xs) y else g ys
-- Reinhard Zumkeller, Aug 15 2015
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Oct 28 2002
EXTENSIONS
More terms from R. J. Mathar, Nov 12 2006
STATUS
approved