OFFSET
1,2
COMMENTS
a(n) = A178403(n+1) for n < 38. - Reinhard Zumkeller, May 27 2010
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
MATHEMATICA
okQ[n_]:=Max[Abs[Last[#]-First[#]]&/@Partition[IntegerDigits[n], 2, 1]]<2
Select[Range[350], okQ] (* Harvey P. Dale, Feb 14 2011 *)
PROG
(Haskell)
a032981 n = a032981_list !! (n-1)
a032981_list = map read $ filter f $ map show [1..] :: [Int] where
f ps = all (`elem` neighbours) $ zipWith ((. return) . (:)) ps (tail ps)
neighbours = "09" : "90" : zipWith ((. return) . (:))
(digs ++ tail digs ++ init digs) (digs ++ init digs ++ tail digs)
digs = "0123456789"
-- Reinhard Zumkeller, Feb 14 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved