OFFSET
1,6
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, ...
LINKS
Alois P. Heinz, Rows n = 1..800, flattened
EXAMPLE
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<i then
if R[i]=1 then
P:=R[1..i-1];
else
N:=R[1..m-1];
P:=R[m..i-1];
fi;
break;
fi;
od;
return(op(N), op(P));
end:
seq(a(n), n=1..19);
CROSSREFS
KEYWORD
nonn,base,tabf
AUTHOR
Martin Renner, Apr 11 2017
STATUS
approved