Sum of the digits of n is substring of n: Difference between revisions

(Added Sidef)
Line 896:
{{out}}
<pre>0 1 2 3 4 5 6 7 8 9 10 20 30 40 50 60 70 80 90 100 109 119 129 139 149 159 169 179 189 199 200 300 400 500 600 700 800 900 910 911 912 913 914 915 916 917 918 919</pre>
 
=={{header|jq}}==
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
<lang jq>
def sum_of_digits_is_substring:
tostring
| . as $s
| (explode | map([.]|implode))
| (map(tonumber)|add|tostring) as $ss
| $s | index($ss);
 
[range(0;1000) | select(sum_of_digits_is_substring)]</lang>
{{out}}
<pre>
[0,1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100,109,119,129,139,149,159,169,179,189,199,200,300,400,500,600,700,800,900,910,911,912,913,914,915,916,917,918,919]
</pre>
 
=={{header|Julia}}==
2,519

edits