login
A038555
Derivative of n in base 3.
1
0, 0, 0, 1, 2, 0, 2, 0, 1, 3, 4, 5, 7, 8, 6, 2, 0, 1, 6, 7, 8, 1, 2, 0, 5, 3, 4, 9, 10, 11, 13, 14, 12, 17, 15, 16, 21, 22, 23, 25, 26, 24, 20, 18, 19, 6, 7, 8, 1, 2, 0, 5, 3, 4, 18, 19, 20, 22, 23, 21, 26, 24, 25, 3, 4, 5, 7, 8, 6, 2, 0, 1, 15, 16, 17, 10, 11, 9, 14, 12, 13, 27, 28, 29
OFFSET
0,5
LINKS
FORMULA
Write n in ternary, replace each pair of adjacent digits by their modulo 3 sum.
EXAMPLE
15 = 120 in ternary, derivative is 02 = 2, so a(15)=2.
MATHEMATICA
Table[FromDigits[Mod[Total[#], 3]&/@Partition[IntegerDigits[n, 3], 2, 1], 3], {n, 0, 100}] (* Harvey P. Dale, Nov 01 2024 *)
PROG
(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
CROSSREFS
Cf. A038554.
Cf. A030341.
Sequence in context: A323226 A307197 A328949 * A138108 A158777 A393358
KEYWORD
nonn,nice,easy,base
EXTENSIONS
More terms from Erich Friedman
Formula corrected by Reinhard Zumkeller, May 26 2013
STATUS
approved