login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A132140 Numbers containing no zeros in ternary representation and with an initial 1. 5
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Intersection of A032924 and A132141;
A132138(A132139(a(n))) = 1.
LINKS
EXAMPLE
14 is in the sequence because its ternary representation is 112;
15 is not in the sequence because its ternary representation is 120.
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 *)
PROG
(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
CROSSREFS
Sequence in context: A003969 A326828 A348398 * A102703 A283483 A288755
KEYWORD
nonn,base,easy
AUTHOR
Reinhard Zumkeller, Aug 20 2007
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)