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.

A276981 Irregular triangle T(n,k) read by rows of residue classes of powers of 10 modulo n.

Original entry on oeis.org

0, 1, 0, 1, 1, 2, 0, 1, 0, 1, 4, 1, 3, 2, 6, 4, 5, 1, 2, 4, 0, 1, 1, 0, 1, 10, 1, 10, 4, 1, 10, 9, 12, 3, 4, 1, 10, 2, 6, 4, 12, 8, 1, 10, 1, 10, 4, 8, 0, 1, 10, 15, 14, 4, 6, 9, 5, 16, 7, 2, 3, 13, 11, 8, 12, 1, 10, 1, 10, 5, 12, 6, 3, 11, 15, 17, 18, 9, 14, 7, 13, 16, 8, 4, 2
Offset: 1

Views

Author

Martin Renner, Apr 11 2017

Keywords

Comments

The length of the nonperiodic part of the residue class values is given in A051628, the length of the periodic part is given in A007732.
These residue class values are useful to check the divisibility of a number by the divisor n simply by calculating the weighted sum of digits. For example, the number 86415 is divisible by 7, because the weighted sum of digits 5*1 + 1*3 + 4*2 + 6*6 + 8*4 = 84 is divisible by 7. The used weights are the residue class values for n = 7: 1, 3, 2, 6, 4, 5, ... for ones, tens, hundreds, ...

Examples

			T(n,k), 1 <= k <= A051628(n) + A007732(n), starts with
n = 1:  0
n = 2:  1, 0
n = 3:  1
n = 4:  1, 2, 0
n = 5:  1, 0
n = 6:  1, 4
n = 7:  1, 3, 2, 6, 4, 5
n = 8:  1, 2, 4, 0
n = 9:  1
n = 10: 1, 0
n = 11: 1, 10
n = 12: 1, 10, 4
etc.
		

Crossrefs

Programs

  • Maple
    a:=proc(n)
      local R,N,P,i;
      R:=[seq(10^k mod n,k=0..n)]; # residue class
      N:=[]; # nonperiodic part
      P:=[]; # periodic part
      for i from 1 to nops(R) do
        member(R[i],R,'m');
        if m