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.

A002517 Earliest sequence with a(a(n))=3n.

Original entry on oeis.org

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
Offset: 0

Views

Author

Keywords

Comments

a(3*n+1) = A016789(n), a(3*n+2) = A017197(n). - Reinhard Zumkeller, Jun 04 2015

Crossrefs

Cf. A007494 (sorted), A016789, A017197.

Programs

  • 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
  • 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 *)

Formula

a(3n)=3*a(n), a(3n+1)=3n+2, a(3n+2)=9n+3

Extensions

Formula and more terms from Henry Bottomley, Apr 27 2000