OFFSET
1,1
COMMENTS
Between a(5) and a(6) there are 151 terms that does not satisfy the property. [Bruno Berselli, Oct 26 2012]
EXAMPLE
376 = 8*47 and 3+7+6 = 16 = 8*2.
MATHEMATICA
Select[8*Range[400], Mod[Total[IntegerDigits[#]], 8] == 0 &] (* T. D. Noe, Sep 24 2012 *)
PROG
(JavaScript)
function sumarray(arr) {
t=0;
for (i=0; i<arr.length; i++) t+=arr[i];
return t;
}
k=8;
for(s=1; s<1000; s++) {
a=new Array();
x=(s*k).toString();
for (j=0; j<x.length; j++) a[j]=Number(x.charAt(j));
if (sumarray(a)%k==0) document.write(s*k+", ");
}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jon Perry, Sep 22 2012
STATUS
approved