login
A037381
Numbers k such that every base-3 digit of k is a base-5 digit of k.
7
1, 2, 7, 27, 28, 30, 35, 40, 51, 54, 55, 60, 71, 121, 127, 132, 135, 136, 137, 138, 139, 142, 147, 152, 157, 160, 161, 175, 176, 177, 178, 179, 180, 185, 190, 195, 202, 210, 211, 212, 214, 227, 232, 235, 238, 239, 242, 251, 255
OFFSET
1,2
LINKS
MATHEMATICA
Select[Range[300], SubsetQ[IntegerDigits[#, 5], IntegerDigits[#, 3]]&] (* Harvey P. Dale, Dec 31 2017 *)
PROG
(Haskell)
import Data.List ((\\), nub)
a037381 n = a037381_list !! (n-1)
a037381_list = filter f [1..] where
f x = null $ nub (ds 3 x) \\ nub (ds 5 x)
ds b x = if x > 0 then d : ds b x' else [] where (x', d) = divMod x b
-- Reinhard Zumkeller, May 30 2013
KEYWORD
nonn,base
STATUS
approved