login
Digit sum of n*7 mod 7.
5

%I #16 Dec 09 2014 03:34:11

%S 0,5,3,3,1,6,6,4,2,0,0,5,3,3,6,4,4,2,0,5,5,3,1,1,6,4,4,2,5,3,3,1,6,6,

%T 4,2,2,0,5,3,3,1,4,4,2,0,0,5,3,1,1,6,4,4,2,0,0,3,1,6,6,4,2,2,0,5,5,3,

%U 1,6,6,2,0,0,5,3,3,1,6,4,4,2,0,0,5,1,1,6

%N Digit sum of n*7 mod 7.

%C Zeros correspond to A216994.

%e a(8) corresponds to the digit sum of 56, which is 11, mod 7, so a(8)=4.

%t Table[Mod[Total[IntegerDigits[7*n]], 7], {n, 100}] (* _T. D. Noe_, Sep 24 2012 *)

%o (JavaScript)

%o function sumarray(arr) {

%o t=0;

%o for (i=0;i<arr.length;i++) t+=arr[i];

%o return t;

%o }

%o k=7;

%o for(s=1;s<100;s++) {

%o a=new Array();

%o x=(s*k).toString();

%o for (j=0;j<x.length;j++) a[j]=Number(x.charAt(j));

%o document.write(sumarray(a)%k+",");

%o }

%Y Cf. A216994, A216995, A216996, A216997, A217009.

%K nonn,base

%O 1,2

%A _Jon Perry_, Sep 22 2012