cp's OEIS Frontend

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.

A132140 Numbers containing no zeros in ternary representation and with an initial 1.

Original entry on oeis.org

1, 4, 5, 13, 14, 16, 17, 40, 41, 43, 44, 49, 50, 52, 53, 121, 122, 124, 125, 130, 131, 133, 134, 148, 149, 151, 152, 157, 158, 160, 161, 364, 365, 367, 368, 373, 374, 376, 377, 391, 392, 394, 395, 400, 401, 403, 404, 445, 446, 448, 449, 454, 455, 457, 458, 472
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 20 2007

Keywords

Comments

Intersection of A032924 and A132141;
A132138(A132139(a(n))) = 1.

Examples

			14 is in the sequence because its ternary representation is 112;
15 is not in the sequence because its ternary representation is 120.
		

Crossrefs

Programs

  • Haskell
    a132140 n = a132140_list !! (n-1)
    a132140_list = filter f [1..] where
       f x = x < 3 && x == 1 || t > 0 && f x' where (x', t) = divMod x 3
    -- Reinhard Zumkeller, Feb 06 2015
  • Maple
    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
  • Mathematica
    Flatten[Table[FromDigits[Join[{1},#],3]&/@Tuples[{1,2},n],{n,0,5}]] (* Harvey P. Dale, Jan 28 2015 *)