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.

A053838 a(n) = (sum of digits of n written in base 3) modulo 3.

This page as a plain text file.
%I A053838 #68 Mar 01 2025 01:29:57
%S A053838 0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,1,2,0,2,0,1,0,
%T A053838 1,2,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,2,0,1,0,1,2,1,2,0,0,1,2,1,2,
%U A053838 0,2,0,1,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0
%N A053838 a(n) = (sum of digits of n written in base 3) modulo 3.
%C A053838 Start with 0, repeatedly apply the morphism 0->012, 1->120, 2->201. This is a ternary version of the Thue-Morse sequence A010060. See Brlek (1989). - _N. J. A. Sloane_, Jul 10 2012
%C A053838 A090193 is generated by the same mapping starting with 1. A090239 is generated by the same mapping starting with 2. - _Andrey Zabolotskiy_, May 04 2016
%H A053838 Vincenzo Librandi, <a href="/A053838/b053838.txt">Table of n, a(n) for n = 0..2000</a>
%H A053838 S. Brlek, <a href="http://dx.doi.org/10.1016/0166-218X(92)90274-E">Enumeration of factors in the Thue-Morse word</a>, Discrete Applied Math. 24 (1989), 83-96.
%H A053838 Arthur Dolgopolov, <a href="https://arthurdolgopolov.net/papers/TM.pdf">Equitable Sequencing and Allocation Under Uncertainty</a>, Preprint, 2016.
%H A053838 Glen Joyce C. Dulatre, Jamilah V. Alarcon, Vhenedict M. Florida, and Daisy Ann A. Disu, <a href="http://www.dmmmsu-sluc.com/wp-content/uploads/2018/03/CAS-Monitor-2016-2017-1.pdf">On Fractal Sequences</a>, DMMMSU-CAS Science Monitor (2016-2017) Vol. 15 No. 2, 109-113.
%H A053838 Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a>
%H A053838 Michel Rigo, <a href="http://arxiv.org/abs/1602.03364">Relations on words</a>, arXiv preprint arXiv:1602.03364 [cs.FL], 2016. See Example 17.
%H A053838 Robert Walker, <a href="http://robertinventor.com/ftswiki/Self_Similar_Sloth_Canon_Number_Sequences">Self Similar Sloth Canon Number Sequences</a>
%H A053838 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%F A053838 a(n) = A010872(A053735(n)) =(n+a(floor[n/3])) mod 3. So one can construct sequence by starting with 0 and mapping 0->012, 1->120 and 2->201 (e.g. 0, 012, 012120201, 012120201120201012201012120, ...) and looking at n-th digit of a term with sufficient digits.
%F A053838 a(n) = A004128(n) mod 3. [_Gary W. Adamson_, Aug 24 2008]
%p A053838 A053838 := proc(n)
%p A053838     add(d,d=convert(n,base,3)) ;
%p A053838     modp(%,3) ;
%p A053838 end proc:
%p A053838 seq(A053838(n),n=0..100) ; # _R. J. Mathar_, Nov 04 2017
%t A053838 Nest[ Flatten[ # /. {0 -> {0, 1, 2}, 1 -> {1, 2, 0}, 2 -> {2, 0, 1}}] &, {0}, 7] (* _Robert G. Wilson v_, Mar 08 2005 *)
%o A053838 (PARI) a(n) = vecsum(digits(n, 3)) % 3; \\ _Michel Marcus_, May 04 2016
%o A053838 (Python)
%o A053838 from sympy.ntheory import digits
%o A053838 def A053838(n): return sum(digits(n,3)[1:])%3 # _Chai Wah Wu_, Feb 28 2025
%Y A053838 Cf. A004128, A010060, A053837, A053839-A053844.
%Y A053838 Equals A026600(n+1) - 1.
%K A053838 base,nonn
%O A053838 0,3
%A A053838 _Henry Bottomley_, Mar 28 2000