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.
%I A276981 #14 Mar 25 2022 14:05:32 %S A276981 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, %T A276981 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, %U A276981 13,11,8,12,1,10,1,10,5,12,6,3,11,15,17,18,9,14,7,13,16,8,4,2 %N A276981 Irregular triangle T(n,k) read by rows of residue classes of powers of 10 modulo n. %C A276981 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. %C A276981 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, ... %H A276981 Alois P. Heinz, <a href="/A276981/b276981.txt">Rows n = 1..800, flattened</a> %e A276981 T(n,k), 1 <= k <= A051628(n) + A007732(n), starts with %e A276981 n = 1: 0 %e A276981 n = 2: 1, 0 %e A276981 n = 3: 1 %e A276981 n = 4: 1, 2, 0 %e A276981 n = 5: 1, 0 %e A276981 n = 6: 1, 4 %e A276981 n = 7: 1, 3, 2, 6, 4, 5 %e A276981 n = 8: 1, 2, 4, 0 %e A276981 n = 9: 1 %e A276981 n = 10: 1, 0 %e A276981 n = 11: 1, 10 %e A276981 n = 12: 1, 10, 4 %e A276981 etc. %p A276981 a:=proc(n) %p A276981 local R,N,P,i; %p A276981 R:=[seq(10^k mod n,k=0..n)]; # residue class %p A276981 N:=[]; # nonperiodic part %p A276981 P:=[]; # periodic part %p A276981 for i from 1 to nops(R) do %p A276981 member(R[i],R,'m'); %p A276981 if m<i then %p A276981 if R[i]=1 then %p A276981 P:=R[1..i-1]; %p A276981 else %p A276981 N:=R[1..m-1]; %p A276981 P:=R[m..i-1]; %p A276981 fi; %p A276981 break; %p A276981 fi; %p A276981 od; %p A276981 return(op(N),op(P)); %p A276981 end: %p A276981 seq(a(n),n=1..19); %Y A276981 Cf. A007732, A051628. %K A276981 nonn,base,tabf %O A276981 1,6 %A A276981 _Martin Renner_, Apr 11 2017