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.

A242399 Write n and 3n in ternary representation and add all trits modulo 3.

Original entry on oeis.org

0, 4, 8, 12, 16, 11, 24, 19, 23, 36, 40, 44, 48, 52, 47, 33, 28, 32, 72, 76, 80, 57, 61, 56, 69, 64, 68, 108, 112, 116, 120, 124, 119, 132, 127, 131, 144, 148, 152, 156, 160, 155, 141, 136, 140, 99, 103, 107, 84, 88, 83, 96, 91, 95, 216, 220, 224, 228, 232
Offset: 0

Views

Author

Reinhard Zumkeller, May 13 2014

Keywords

Examples

			n = 25, 3*n = 75:
.  A007089(25) =  221
.  A007089(75) = 2210
.   add trits    ----
.    modulo 3    2101 = A007089(64), hence a(25) = 64.
		

Crossrefs

Programs

  • Haskell
    a242399 n = foldr (\t v -> 3 * v + t) 0 $
                      map (flip mod 3) $ zipWith (+) ([0] ++ ts) (ts ++ [0])
                where ts = a030341_row n

Formula

a(n) <= 4*n; a(m) = 4*m iff m is a term of A242407.
a(n) = A008586(n) - A242400(n).