A037399 Numbers k such that every base-6 digit of k is a base-8 digit of k.
1, 2, 3, 4, 5, 28, 80, 85, 86, 98, 115, 160, 172, 213, 266, 331, 345, 532, 691, 699, 705, 708, 717, 720, 727, 763, 765, 792, 799, 811, 819, 835, 851, 859, 861, 863, 864, 900, 916, 928, 1036, 1061, 1068, 1085, 1093, 1128, 1129, 1130
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
import Data.List ((\\), nub) a037399 n = a037399_list !! (n-1) a037399_list = filter f [1..] where f x = null $ nub (ds 6 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
b68Q[n_]:=Module[{b6=Union[IntegerDigits[n,6]],b8=Union[IntegerDigits[ n,8]]}, And@@Table[ MemberQ[b8,b6[[i]]],{i,Length[b6]}]]; Select[Range[ 1200],b68Q] (* Harvey P. Dale, Mar 24 2012 *)