login
A216997
Multiples of 8 that have a digit sum which is a multiple of 8.
8
8, 80, 88, 152, 224, 376, 440, 448, 512, 592, 664, 736, 800, 808, 880, 888, 952, 1016, 1096, 1160, 1168, 1232, 1304, 1384, 1456, 1520, 1528, 1672, 1744, 1816, 1896, 1960, 1968, 2024, 2176, 2240, 2248, 2312, 2392, 2464, 2536, 2600, 2608, 2680, 2688, 2752, 2824
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