A037402 Numbers k such that every base-7 digit of k is a base-8 digit of k.
1, 2, 3, 4, 5, 6, 8, 16, 24, 32, 40, 48, 57, 85, 94, 106, 114, 133, 142, 163, 171, 196, 204, 212, 220, 224, 225, 226, 227, 228, 229, 230, 236, 244, 277, 285, 305, 334, 342, 385, 392, 401, 540, 546, 547, 550, 597, 620, 629, 646, 688
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
import Data.List ((\\), nub) a037402 n = a037402_list !! (n-1) a037402_list = filter f [1..] where f x = null $ nub (ds 7 x) \\ nub (ds 8 x) ds b x = if x > 0 then d : ds b x' else [] where (x', d) = divMod x b -- Reinhard Zumkeller, May 30 2013
-
Mathematica
b7b8Q[n_]:=Module[{idn7=Union[IntegerDigits[n,7]]},Intersection[ idn7, Union[ IntegerDigits[n,8]]]==idn7]; Select[Range[700],b7b8Q] (* Harvey P. Dale, Dec 15 2013 *)