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 A132140 #15 Apr 06 2019 23:13:26 %S A132140 1,4,5,13,14,16,17,40,41,43,44,49,50,52,53,121,122,124,125,130,131, %T A132140 133,134,148,149,151,152,157,158,160,161,364,365,367,368,373,374,376, %U A132140 377,391,392,394,395,400,401,403,404,445,446,448,449,454,455,457,458,472 %N A132140 Numbers containing no zeros in ternary representation and with an initial 1. %C A132140 Intersection of A032924 and A132141; %C A132140 A132138(A132139(a(n))) = 1. %H A132140 R. Zumkeller, <a href="/A132140/b132140.txt">Table of n, a(n) for n = 1..10000</a> %H A132140 <a href="/index/Ar#3-automatic">Index entries for 3-automatic sequences</a>. %e A132140 14 is in the sequence because its ternary representation is 112; %e A132140 15 is not in the sequence because its ternary representation is 120. %p A132140 a:=proc(n) local nn, L: nn:=convert(n,base,3): L:=nops(nn): if nn[L]=1 and 0 < product(nn[j],j=1..L) then n else end if end proc: seq(a(n),n=1..500); # _Emeric Deutsch_, Sep 09 2007 %t A132140 Flatten[Table[FromDigits[Join[{1},#],3]&/@Tuples[{1,2},n],{n,0,5}]] (* _Harvey P. Dale_, Jan 28 2015 *) %o A132140 (Haskell) %o A132140 a132140 n = a132140_list !! (n-1) %o A132140 a132140_list = filter f [1..] where %o A132140 f x = x < 3 && x == 1 || t > 0 && f x' where (x', t) = divMod x 3 %o A132140 -- _Reinhard Zumkeller_, Feb 06 2015 %Y A132140 Cf. A032924, A132141, A132138, A132139, A007089. %K A132140 nonn,base,easy %O A132140 1,2 %A A132140 _Reinhard Zumkeller_, Aug 20 2007