The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A002517 Earliest sequence with a(a(n))=3n. 10
0, 2, 3, 6, 5, 12, 9, 8, 21, 18, 11, 30, 15, 14, 39, 36, 17, 48, 27, 20, 57, 24, 23, 66, 63, 26, 75, 54, 29, 84, 33, 32, 93, 90, 35, 102, 45, 38, 111, 42, 41, 120, 117, 44, 129, 108, 47, 138, 51, 50, 147, 144, 53, 156, 81, 56, 165, 60, 59, 174, 171, 62, 183, 72, 65, 192 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
a(3*n+1) = A016789(n), a(3*n+2) = A017197(n). - Reinhard Zumkeller, Jun 04 2015
LINKS
FORMULA
a(3n)=3*a(n), a(3n+1)=3n+2, a(3n+2)=9n+3
MATHEMATICA
a[n_] := a[n] = Which[ Mod[n, 3] == 0, 3*a[n/3], Mod[n, 3] == 1, n+1, True, 3*(n-1)]; Table[a[n], {n, 0, 65}] (* Jean-François Alcover, Sep 24 2012 *)
PROG
(Haskell)
import Data.List (transpose)
a002517 n = a002517_list !! n
a002517_list = 0 : concat
(transpose [[2, 5 ..], [3, 12 ..], map (* 3) $ tail a002517_list])
-- Reinhard Zumkeller, Jun 04 2015
CROSSREFS
Cf. A007494 (sorted), A016789, A017197.
Sequence in context: A095113 A345179 A367584 * A253568 A053570 A129647
KEYWORD
nonn,nice,easy
AUTHOR
EXTENSIONS
Formula and more terms from Henry Bottomley, Apr 27 2000
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 May 21 17:21 EDT 2024. Contains 372738 sequences. (Running on oeis4.)