OFFSET
1,3
COMMENTS
This sequence is different from A061383. Here digits in k must have all the same parity, otherwise the average of at least a pair of digits wouldn't be an integer. Note that for every 2-digit term in A061383 both digits have the same parity. But not every number whose digits have all the same parity (sequence A059708) belongs here.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..177 (all terms up to 1 million)
FORMULA
Apparently a(158+n) = A010785(35+n).
EXAMPLE
17 is in this sequence because the set of digits (1,7) has an integer average: 4.
159 and 195 are in this sequence because the sets of digits (1,5), (1,9), (5,9), and (1,5,9) all have integer averages, respectively: 3, 5, 7, and 5.
MATHEMATICA
Select[Range[0, 200], AllTrue[Mean/@Subsets[IntegerDigits[#], {2, IntegerLength[ #]}], IntegerQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 09 2020 *)
PROG
(PARI) firstTerms_vec(n)={my(v=vector(n), c, t, w:list, h); for(i=1, +oo, w=List(); forsubset(i, k, listput(w, k)); listpop(w, 1); forvec(j=vector(i, z, [(z==1)&&(i>1), 9]), h=j[1]%2; for(l=2, #j, if((j[l]%2)!=h, next(2))); for(k=1, #w, t=vecextract(j, w[k]); if(vecsum(t)%(#w[k]), next(2))); v[c++]=fromdigits(j); if(c==n, return(v))))}
(PARI) isok(m, {B=10})={my(w=digits(m, B)); forsubset(#w, y, if(y!=Vecsmall([]), if(vecsum(vecextract(w, y))%(#y), return(0)), next)); 1}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
R. J. Cano, Feb 21 2019
STATUS
approved