login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
(J) ab3 =: 3&#.^:_1
sp =: 2&(+/\)"1
> (3 | sp)&.ab3&.> ; / i. 100 NB. Stephen Makdisi, May 26 2018
CROSSREFS
Cf. A038554.
Cf. A030341.
Sequence in context: A323226 A307197 A328949 * A138108 A158777 A039970
KEYWORD
nonn,nice,easy,base
EXTENSIONS
More terms from Erich Friedman
Formula corrected by Reinhard Zumkeller, May 26 2013
STATUS
approved