OFFSET
1,2
COMMENTS
The first 9 natural numbers, then the numbers with Sum_of_Digits <= 2. - Stefan Steinerberger, Feb 07 2006
EXAMPLE
sum(10)=1 and 1 mod 10 <= 2
MATHEMATICA
Select[Range[10001000], Mod[Total[IntegerDigits[#]], #]<3&] (* Harvey P. Dale, May 06 2018 *)
PROG
(Perl) #!/usr/local/bin/perl -w for $i (1..1000000){ @j = split "", $i; $sum=0; for (@j){ $sum += $_; } print "$i, " if ($sum % $i <=2); } __END__
CROSSREFS
KEYWORD
nonn
AUTHOR
gamo (gamo(AT)telecable.es), Dec 23 2004
EXTENSIONS
More terms from Stefan Steinerberger, Feb 07 2006
Corrected by Harvey P. Dale, May 06 2018
STATUS
approved