This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A037406 #16 Aug 22 2021 09:22:18 %S A037406 1,2,3,4,5,6,7,45,105,127,235,274,365,436,487,614,713,731,1017,1024, %T A037406 1025,1026,1032,1042,1124,1162,1206,1233,1234,1235,1243,1273,1426, %U A037406 1462,1603,1630,1653,1723,1737,1739,1743,1753,2048 %N A037406 Numbers k such that every base-8 digit of k is a base-10 digit of k. %H A037406 Reinhard Zumkeller, <a href="/A037406/b037406.txt">Table of n, a(n) for n = 1..10000</a> %t A037406 b8dQ[n_]:=Module[{idn=Union[IntegerDigits[n]],idn8=Union[IntegerDigits[n,8]]},And@@Table[MemberQ[idn,idn8[[i]]],{i,Length[idn8]}]] %t A037406 Select[Range[2100],b8dQ] (* _Harvey P. Dale_, Feb 27 2011 *) %o A037406 (Haskell) %o A037406 import Data.List ((\\), nub) %o A037406 a037406 n = a037406_list !! (n-1) %o A037406 a037406_list = filter f [1..] where %o A037406 f x = null $ nub (ds 8 x) \\ nub (ds 10 x) %o A037406 ds b x = if x > 0 then d : ds b x' else [] where (x', d) = divMod x b %o A037406 -- _Reinhard Zumkeller_, May 30 2013 %o A037406 (Python) %o A037406 def ok(n): return set(oct(n)[2:]) <= set(str(n)) %o A037406 print(list(filter(ok, range(1, 2049)))) # _Michael S. Branicky_, Aug 22 2021 %Y A037406 Cf. A037405, A037442. %K A037406 nonn,base %O A037406 1,2 %A A037406 _Clark Kimberling_