OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
MATHEMATICA
b8dQ[n_]:=Module[{idn=Union[IntegerDigits[n]], idn8=Union[IntegerDigits[n, 8]]}, And@@Table[MemberQ[idn, idn8[[i]]], {i, Length[idn8]}]]
Select[Range[2100], b8dQ] (* Harvey P. Dale, Feb 27 2011 *)
PROG
(Haskell)
import Data.List ((\\), nub)
a037406 n = a037406_list !! (n-1)
a037406_list = filter f [1..] where
f x = null $ nub (ds 8 x) \\ nub (ds 10 x)
ds b x = if x > 0 then d : ds b x' else [] where (x', d) = divMod x b
-- Reinhard Zumkeller, May 30 2013
(Python)
def ok(n): return set(oct(n)[2:]) <= set(str(n))
print(list(filter(ok, range(1, 2049)))) # Michael S. Branicky, Aug 22 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved