0,5

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

Write n in ternary, replace each pair of adjacent digits by their modulo 3 sum.

15 = 120 in ternary, derivative is 02 = 2, so a(15)=2.

(Haskell)

a038555 n = foldr (\d v -> v * 3 + d) 0 $

zipWith (\x y -> (x + y) `mod` 3) ts $ tail ts

where ts = a030341_row n

-- Reinhard Zumkeller, May 26 2013

(J) ab3 =: 3&#.^:_1

sp =: 2&(+/\)"1

> (3 | sp)&.ab3&.> ; / i. 100 NB. Stephen Makdisi, May 26 2018

Cf. A038554.

Cf. A030341.

Sequence in context: A323226 A307197 A328949 * A138108 A158777 A039970

Adjacent sequences: A038552 A038553 A038554 * A038556 A038557 A038558

nonn,nice,easy,base

N. J. A. Sloane

More terms from Erich Friedman

Formula corrected by Reinhard Zumkeller, May 26 2013

approved