A037394 Numbers k such that every base-5 digit of k is a base-7 digit of k.
1, 2, 3, 4, 17, 51, 66, 102, 109, 123, 156, 158, 162, 206, 218, 312, 317, 324, 361, 381, 416, 418, 423, 458, 462, 463, 466, 467, 468, 472, 494, 518, 545, 546, 549, 556, 557, 559, 562, 584, 606, 619, 621, 630, 640, 651, 658, 687
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
import Data.List ((\\), nub) a037394 n = a037394_list !! (n-1) a037394_list = filter f [1..] where f x = null $ nub (ds 5 x) \\ nub (ds 7 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
Select[Range[700],SubsetQ[IntegerDigits[#,7],IntegerDigits[#,5]]&] (* Harvey P. Dale, Sep 29 2017 *)
Comments