OFFSET
1,1
COMMENTS
Suppose the decimal expansion of n is n = d(p)d(p-1)…d(0).
Then we require that n mod (s-d(k)) = d(k) for k=0..p. [D. S. McNeil, Nov 21 2010; N. J. A. Sloane, Nov 20 2010]
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
2537 is in the sequence because 2537 mod (5+3+7) = 2, 2537 mod (2+3+7) = 5, etc.
11 is not a member because 11 mod 1 is 0 not 1.
MAPLE
with(numtheory):T:=array(1..2000):for n from 1 to 3000 do:ind:=0: l:=length(n)
: n0:=n:indic:=0:s:=0:p:=1:for m from 1 to l do: q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v
:s:=s+u: T[m]:=u:od:for i from 1 to l do:x:=T[i]: if (s-x) <>0 and irem(n, s-x)=x
then ind:=ind+1:else fi:od:if ind=l then printf(`%d, `, n):else fi:od:
MATHEMATICA
Quiet@ Select[ Range[3000], (d = IntegerDigits@#; Mod[#, Total[d] - d] == d) &] (* Giovanni Resta, Mar 12 2019 *)
PROG
(PARI) isok(n) = {my(d = digits(n), s = vecsum(d)); for (k=1, #d, if (!(s-d[k]) || ((n % (s-d[k]) != d[k])), return(0)); ); 1; } \\ Michel Marcus, Mar 12 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Nov 20 2010
EXTENSIONS
Definition clarified by D. S. McNeil, Nov 20 2010
I rewrote the definition, comments and the example to take into account D. S. McNeil's clarifications. - N. J. A. Sloane, Nov 20 2010
STATUS
approved