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.

Showing 1-8 of 8 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

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
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

Crossrefs

Equals A026600(n+1) - 1.

Programs

  • Maple
    A053838 := proc(n)
        add(d,d=convert(n,base,3)) ;
        modp(%,3) ;
    end proc:
    seq(A053838(n),n=0..100) ; # R. J. Mathar, Nov 04 2017
  • Mathematica
    Nest[ Flatten[ # /. {0 -> {0, 1, 2}, 1 -> {1, 2, 0}, 2 -> {2, 0, 1}}] &, {0}, 7] (* Robert G. Wilson v, Mar 08 2005 *)
  • PARI
    a(n) = vecsum(digits(n, 3)) % 3; \\ Michel Marcus, May 04 2016
    
  • Python
    from sympy.ntheory import digits
    def A053838(n): return sum(digits(n,3)[1:])%3 # Chai Wah Wu, Feb 28 2025

Formula

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.
a(n) = A004128(n) mod 3. [Gary W. Adamson, Aug 24 2008]

A053837 Sum of digits of n modulo 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Examples

			a(59)=4 because 5+9 = 14 = 4 mod 10.
		

Crossrefs

Programs

Formula

a(n) = A010879(A007953(n)) = (n+a(floor[n/10])) mod 10. So can construct sequence by starting with 0 and mapping 0->0123456789, 1->1234567890, 2->2345678901 etc. (e.g. 0, 0123456789, 0123456789123456789023456789013456789012456..., etc.) and looking at n-th digit of a term with sufficient digits.

A053839 a(n) = (sum of digits of n written in base 4) modulo 4.

Original entry on oeis.org

0, 1, 2, 3, 1, 2, 3, 0, 2, 3, 0, 1, 3, 0, 1, 2, 1, 2, 3, 0, 2, 3, 0, 1, 3, 0, 1, 2, 0, 1, 2, 3, 2, 3, 0, 1, 3, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 0, 3, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 0, 2, 3, 0, 1, 1, 2, 3, 0, 2, 3, 0, 1, 3, 0, 1, 2, 0, 1, 2, 3, 2, 3, 0, 1, 3, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 0, 3, 0, 1, 2, 0, 1, 2, 3, 1
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

a(n) is the third row of the array in A141803. - Andrey Zabolotskiy, May 16 2016
This is the fixed point of the morphism 0->0123, 1->1230, 2->2301, 3->3012 starting with 0. Let t be the (nonperiodic) sequence of positions of 0, and likewise, u for 1, v for 2, and w for 3; then t(n)/n -> 4, u(n)/n -> 4, v(n)/n -> 4, w(n)/n -> 4, and t(n) + u(n) + v(n) + w(n) = 16*n - 6 for n >= 1. - Clark Kimberling, May 31 2017

Examples

			First three iterations of the morphism 0->0123, 1->1230, 2->2301, 3->3012:
  0123
  0123123023013012
  0123123023013012123023013012012323013012012312303012012312302301
		

Crossrefs

Programs

  • Maple
    seq(convert(convert(n,base,4),`+`) mod 4, n=0..100); # Robert Israel, May 18 2016
  • Mathematica
    Mod[Total@ IntegerDigits[#, 4], 4] & /@ Range[0, 120] (* Michael De Vlieger, May 17 2016 *)
    s = Nest[Flatten[# /. {0 -> {0, 1, 2, 3}, 1 -> {1, 2, 3, 0}, 2 -> {2, 3, 0, 1}, 3 -> {3, 0, 1, 2}}] &, {0}, 9];   (* - Clark Kimberling, May 31 2017 *)
  • PARI
    a(n) = vecsum(digits(n,4)) % 4; \\ Michel Marcus, May 16 2016
    
  • PARI
    a(n) = sumdigits(n, 4) % 4; \\ Michel Marcus, Jul 04 2018

Formula

a(n) = A010873(A053737(n)). - Andrey Zabolotskiy, May 18 2016
G.f. G(x) satisfies x^81*G(x) - (x^72+x^75+x^78+x^81)*G(x^4) + (x^48+x^60+x^63-x^64+x^72+x^75-x^76+x^78-x^79-x^88-x^91-x^94)*G(x^16) + (-1+x^16-x^48-x^60-x^63+2*x^64+x^76+x^79-x^80+x^112+x^124+x^127-x^128-x^140-x^143)*G(x^64) + (1-x^16-x^64+x^80-x^256+x^272+x^320-x^336)*G(x^256) = 0. - Robert Israel, May 18 2016

A141803 Triangle read by rows derived from generalized Thue-Morse sequences.

Original entry on oeis.org

1, 1, 1, 1, 2, 0, 1, 2, 1, 1, 1, 2, 3, 2, 0, 1, 2, 3, 1, 0, 0, 1, 2, 3, 4, 2, 2, 1, 1, 2, 3, 4, 1, 3, 0, 1, 1, 2, 3, 4, 5, 2, 0, 1, 0, 1, 2, 3, 4, 5, 1, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 2, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 1, 3, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 2, 4, 2, 1, 2, 1, 1, 2, 3, 4, 5, 6, 7, 1, 3, 5, 3, 3, 0, 1
Offset: 1

Views

Author

Gary W. Adamson and Roger L. Bagula, Jul 06 2008

Keywords

Comments

Triangle read by rows, antidiagonals of an array composed of generalized Thue-Morse sequences [defined in A010060, comment of Zizka]. For each row of the array, n>0; n-th term of m-th row (m>0) = sum of digits of n in base (m+1), mod (m+1).
Every row of the array starting from the n-th one as well as every row of the triangle starting from the (2*n-1)-th one begins from (1,2,3,...,n).
Row sums = A141804: (1, 2, 3, 5, 8, 7, 15, 15, 18, 22,...).
Row 1 of the array (corresponding to base 2) = A010060 (n>0), rows 2 - 8 are the sequences A053838 - A053844, row 9 = A053837.

Examples

			First few rows of the array are:
1, 1, 0, 1, 0, 0, 1, 1,...
1, 2, 1, 2, 0, 2, 0, 1,...
1, 2, 3, 1, 2, 3, 0, 2,...
1, 2, 3, 4, 1, 2, 3, 4,...
1, 2, 3, 4, 5, 1, 2, 3,...
1, 2, 3, 4, 5, 6, 1, 2,...
...
Triangle = antidiagonals of the array:
1;
1, 1;
1, 2, 0;
1, 2, 1, 1;
1, 2, 3, 2, 0;
1, 2, 3, 1, 0, 0;
1, 2, 3, 4, 2, 2, 1;
1, 2, 3, 4, 1, 3, 0, 1;
1, 2, 3, 4, 5, 2, 0, 1, 0;
1, 2, 3, 4, 5, 1, 3, 2, 1, 0;
1, 2, 3, 4, 5, 6, 2, 4, 3, 2, 1;
1, 2, 3, 4, 5, 6, 1, 3, 0, 0, 0, 0;
1, 2, 3, 4, 5, 6, 7, 2, 4, 2, 1, 2, 1;
1, 2, 3, 4, 5, 6, 7, 1, 3, 5, 3, 3, 0, 1;
...
a(8) = 2, = (3,2) of the array indicating that in the sequence 1,2,3,...mod 4, sum of digits of "2" mod 4 = 2.
		

Crossrefs

Programs

  • Mathematica
    Flatten@Table[Mod[Total@IntegerDigits[n - i, i], i], {n, 16}, {i, n - 1, 2, -1}] (* Ivan Neretin, Jun 18 2018 *)

Extensions

Explanation in the Comments section corrected by Andrey Zabolotskiy, May 18 2016

A053840 (Sum of digits of n written in base 5) modulo 5.

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 2, 3, 4, 0, 2, 3, 4, 0, 1, 3, 4, 0, 1, 2, 4, 0, 1, 2, 3, 1, 2, 3, 4, 0, 2, 3, 4, 0, 1, 3, 4, 0, 1, 2, 4, 0, 1, 2, 3, 0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 3, 4, 0, 1, 2, 4, 0, 1, 2, 3, 0, 1, 2, 3, 4, 1, 2, 3, 4, 0, 3, 4, 0, 1, 2, 4, 0, 1, 2, 3, 0, 1, 2, 3, 4, 1, 2, 3, 4, 0, 2, 3, 4, 0, 1, 4, 0, 1, 2, 3
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

a(n) is the fourth row of the array in A141803. - Andrey Zabolotskiy, May 16 2016

Crossrefs

Programs

  • Mathematica
    Mod[Total@ IntegerDigits[#, 5], 5] & /@ Range[0, 120] (* Michael De Vlieger, May 17 2016 *)
  • PARI
    a(n) = vecsum(digits(n,5)) % 5; \\ Michel Marcus, May 16 2016

Formula

a(n) = A010874(A053824(n)). - Andrey Zabolotskiy, May 18 2016

A053843 (Sum of digits of n written in base 8) modulo 8.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 0, 2, 3, 4, 5, 6, 7, 0, 1, 3, 4, 5, 6, 7, 0, 1, 2, 4, 5, 6, 7, 0, 1, 2, 3, 5, 6, 7, 0, 1, 2, 3, 4, 6, 7, 0, 1, 2, 3, 4, 5, 7, 0, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 0, 2, 3, 4, 5, 6, 7, 0, 1, 3, 4, 5, 6, 7, 0, 1, 2, 4, 5, 6, 7, 0, 1, 2, 3, 5, 6, 7, 0, 1, 2, 3, 4, 6
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

a(n) is the seventh row of the array in A141803. - Andrey Zabolotskiy, May 18 2016

Crossrefs

Programs

  • Mathematica
    Table[Mod[Plus @@ IntegerDigits[n, 8], 8], {n, 0, 50}] (* G. C. Greubel, Nov 02 2017 *)

Formula

a(n) = A010877(A053829(n)). - Andrey Zabolotskiy, May 18 2016

A053841 (Sum of digits of n written in base 6) modulo 6.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 0, 2, 3, 4, 5, 0, 1, 3, 4, 5, 0, 1, 2, 4, 5, 0, 1, 2, 3, 5, 0, 1, 2, 3, 4, 1, 2, 3, 4, 5, 0, 2, 3, 4, 5, 0, 1, 3, 4, 5, 0, 1, 2, 4, 5, 0, 1, 2, 3, 5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 2, 3, 4, 5, 0, 1, 3, 4, 5, 0, 1, 2, 4, 5, 0, 1, 2, 3, 5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 1, 2, 3
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

a(n) is the fifth row of the array in A141803. - Andrey Zabolotskiy, May 18 2016

Crossrefs

Programs

  • Mathematica
    Mod[DigitSum[Range[0, 100], 6], 6] (* Paolo Xausa, Aug 09 2024 *)
  • PARI
    a(n) = vecsum(digits(n, 6)) % 6; \\ Michel Marcus, May 18 2016

Formula

a(n) = A010875(A053827(n)). - Andrey Zabolotskiy, May 18 2016

A053842 (Sum of digits of n written in base 7) modulo 7.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 0, 2, 3, 4, 5, 6, 0, 1, 3, 4, 5, 6, 0, 1, 2, 4, 5, 6, 0, 1, 2, 3, 5, 6, 0, 1, 2, 3, 4, 6, 0, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 0, 2, 3, 4, 5, 6, 0, 1, 3, 4, 5, 6, 0, 1, 2, 4, 5, 6, 0, 1, 2, 3, 5, 6, 0, 1, 2, 3, 4, 6, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 0, 1
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

a(n) is the sixth row of the array in A141803. - Andrey Zabolotskiy, May 18 2016

Crossrefs

Programs

  • Mathematica
    Table[Mod[Plus @@ IntegerDigits[n, 7], 7], {n, 0, 50}] (* G. C. Greubel, Nov 02 2017 *)
  • PARI
    a(n) = vecsum(digits(n, 7)) % 7; \\ Michel Marcus, May 18 2016

Formula

a(n) = A010876(A053828(n)). - Andrey Zabolotskiy, May 18 2016
Showing 1-8 of 8 results.