Harshad numbers

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Harshad numbers, or Niven numbers, are numbers that are divisible by their digit sum. For example, 392 is divisible by 14 (3+9+2).

Print the first 400 Harshad numbers in base 10.

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

*NOTHING*

Sample output:

1
2
3
4
5
6
7
8
9
10
12
18
20
21
24
27
30
36
40
42
45
48
50
54
60
63
70
72
80
81
84
90
100
102
108
110
111
112
114
117
120
126
132
133
135
140
144
150
152
153
156
162
171
180
190
192
195
198
200
201
204
207
209
210
216
220
222
224
225
228
230
234
240
243
247
252
261
264
266
270
280
285
288
300
306
308
312
315
320
322
324
330
333
336
342
351
360
364
370
372
375
378
392
396
399
400
402
405
407
408
410
414
420
423
432
440
441
444
448
450
460
465
468
476
480
481
486
500
504
506
510
511
512
513
516
518
522
531
540
550
552
555
558
576
588
592
594
600
603
605
612
621
624
629
630
640
644
645
648
660
666
684
690
700
702
704
711
715
720
730
732
735
736
738
756
770
774
777
780
782
792
800
801
803
804
810
820
825
828
832
840
846
864
870
874
880
882
888
900
902
910
912
915
918
935
936
954
960
966
972
990
999
1000
1002
1008
1010
1011
1012
1014
1015
1016
1017
1020
1026
1032
1035
1040
1044
1050
1053
1056
1062
1066
1071
1080
1088
1090
1092
1095
1098
1100
1101
1104
1107
1110
1116
1120
1122
1125
1128
1130
1134
1140
1141
1143
1148
1152
1160
1161
1164
1168
1170
1180
1183
1185
1188
1200
1204
1206
1212
1215
1220
1224
1230
1232
1233
1236
1242
1251
1260
1270
1272
1274
1275
1278
1296
1300
1302
1304
1305
1308
1310
1314
1320
1323
1330
1332
1341
1344
1350
1360
1365
1368
1380
1386
1387
1394
1400
1404
1410
1413
1416
1417
1422
1431
1440
1450
1452
1455
1456
1458
1476
1494
1500
1503
1512
1520
1521
1524
1526
1530
1534
1540
1545
1547
1548
1558
1560
1566
1584
1590
1596
1602
1611
1620
1630
1632
1635
1638
1651
1652
1656
1659
1674
1679
1680
1692
1701
1704
1710
1720
1725
1728
1729
1740
1744
1746
1764
1770
1782
1785
1800
1810
1812
1815
1818
1836
1848
1853
1854
1860
1872
1886
1890
1896
1898
1900
1904
1905
1908
1920
1926
1944
1950
1962
1968
1974
1980
1998
2000

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1clock400.03462012/10/16 06:27:390B / 16B / 24B
2leonid400.02052013/01/05 13:06:440B / 15B / 25B
3teebee400.02542013/02/18 05:28:450B / 16B / 24B
4mitchs400.02302016/03/24 22:16:300B / 19B / 21B
5Histocrat520.06752016/06/21 22:31:410B / 22B / 30B
6yosio810.03542012/10/15 01:35:310B / ?B / ?B

Ruby2 _

RankUserSizeTimeDateStatistics
1mitchs400.08322016/03/24 22:28:220B / 19B / 21B

Perl _

RankUserSizeTimeDateStatistics
1llhuii370.04422016/03/25 20:12:340B / ?B / ?B
2tails370.05342016/03/26 01:05:090B / 17B / 19B
3teebee380.04922012/10/03 20:09:490B / 17B / 19B
4%20380.05362016/12/27 13:07:240B / 17B / 19B

Python _

RankUserSizeTimeDateStatistics
1xsot540.17762016/03/24 21:53:290B / 32B / 19B
2mitchs540.14342016/03/24 21:57:570B / 32B / 19B
3llhuii540.14232016/03/25 15:07:270B / ?B / ?B
4hallvabo550.17532012/10/03 21:08:010B / 34B / 19B
5teebee550.11522012/10/03 23:05:420B / 34B / 18B
6clock550.09532012/10/04 02:46:200B / 34B / 19B
7twobit550.18202012/10/07 10:51:540B / 34B / 18B
8recursive550.10322012/10/23 05:55:080B / 34B / 18B
9leonid550.10792013/01/05 13:02:360B / 34B / 18B
10Volatility550.15052013/03/18 09:01:340B / 34B / 19B

Python3 _

RankUserSizeTimeDateStatistics
1xsot530.04932016/03/24 22:02:320B / 33B / 17B
2mitchs530.06882016/03/24 22:05:200B / 33B / 17B
3llhuii530.06722016/03/25 16:40:100B / ?B / ?B
4teebee560.05882015/01/02 19:24:520B / 38B / 14B

PHP _

RankUserSizeTimeDateStatistics
1teebee570.05302013/07/18 03:47:051B / 31B / 25B

Pike _

RankUserSizeTimeDateStatistics
1teebee720.05902014/03/02 00:25:190B / 34B / 36B
2clock720.04932015/03/12 01:13:240B / 34B / 36B

Common LISP _

RankUserSizeTimeDateStatistics
1ttmh980.19962016/02/24 22:27:040B / 51B / 43B

Arc _

RankUserSizeTimeDateStatistics
1teebee540.97172012/10/19 01:39:540B / 26B / 24B
2clock541.10122012/10/19 02:15:100B / 26B / 24B

Io _

RankUserSizeTimeDateStatistics
1pooq430.18912012/10/08 00:36:280B / 22B / 20B
2clock430.10352013/03/23 12:48:550B / 22B / 20B
3teebee430.14312013/07/07 10:35:180B / 22B / 20B

JavaScript _

RankUserSizeTimeDateStatistics
1nn560.02022012/12/27 21:32:440B / 31B / 25B
2teebee560.03792012/12/27 23:51:560B / 31B / 23B

Lua _

RankUserSizeTimeDateStatistics
1twobit760.02332012/10/07 10:56:280B / 48B / 22B

Xtal _

RankUserSizeTimeDateStatistics
1teebee580.03902012/10/06 03:25:330B / 34B / 24B
2clock580.02182013/09/27 23:54:500B / 34B / 24B
3pooq590.03292012/10/05 17:00:400B / 34B / 25B

SNOBOL _

RankUserSizeTimeDateStatistics
1clock1010.02502013/03/23 01:53:590B / 45B / 25B

Icon _

RankUserSizeTimeDateStatistics
1teebee640.03552012/10/03 20:23:440B / 40B / 19B
2clock640.02542012/10/04 02:40:370B / 40B / 19B

REXX _

RankUserSizeTimeDateStatistics
1*yuko*600.02552015/04/18 15:27:320B / 36B / 19B
2teebee680.01942012/11/15 04:09:010B / 42B / 18B
3clock680.03582012/11/15 07:43:430B / 42B / 18B

PARI/GP _

RankUserSizeTimeDateStatistics
1teebee440.04552012/10/04 15:34:000B / 27B / 17B
2clock440.03112012/10/04 15:38:550B / 27B / 17B
3mitchs440.03252015/03/24 12:13:430B / 27B / 17B

Smalltalk _

RankUserSizeTimeDateStatistics
1clock750.09302013/01/06 08:12:420B / 39B / 35B
2teebee750.07792014/06/08 12:20:160B / 39B / 35B

Prolog _

RankUserSizeTimeDateStatistics
1pooq900.08252013/03/04 17:41:490B / 58B / 30B

BASIC _

RankUserSizeTimeDateStatistics
1teebee730.01842013/03/18 05:17:480B / 50B / 17B
2clock730.01962013/03/18 19:27:360B / 50B / 17B
3pooq740.04682012/10/05 15:40:140B / 50B / 17B

Erlang _

RankUserSizeTimeDateStatistics
1teebee1130.12962016/07/24 17:56:010B / 65B / 44B

J _

RankUserSizeTimeDateStatistics
1I., S.290.14732012/10/06 18:57:210B / 12B / 17B
2pooq300.16392012/10/07 12:20:320B / 8B / 22B
3gareth430.03422012/10/04 03:45:040B / ?B / ?B
4medialuna520.06872014/08/19 20:05:190B / ?B / ?B

A+ _

RankUserSizeTimeDateStatistics
1teebee340.02512013/07/15 15:39:089B / 11B / 14B

K _

RankUserSizeTimeDateStatistics
1twobit250.03822012/10/07 11:06:470B / 9B / 16B
2teebee250.01452012/12/28 08:24:460B / 9B / 16B
3clock250.01562013/04/11 01:33:380B / 8B / 17B

C _

RankUserSizeTimeDateStatistics
1nu630.01522012/10/06 01:37:580B / 33B / 30B
2llhuii640.00012016/03/25 17:50:480B / ?B / ?B
3ush750.01292012/10/06 10:05:120B / 41B / 34B
4fill760.01282012/10/09 10:12:560B / 40B / 36B
5chocobi770.01302016/03/25 21:54:560B / 41B / 36B
6Kipa001490.01142012/10/17 18:28:463B / ?B / ?B

C++ _

RankUserSizeTimeDateStatistics
1smkt1570.00012012/10/05 14:16:530B / 93B / 61B

Haskell _

RankUserSizeTimeDateStatistics
1henkma620.04672012/10/06 08:53:140B / ?B / ?B
2cojna620.05862013/07/10 00:59:010B / 39B / 21B
3tttaki740.00012012/10/14 17:31:420B / 45B / 19B

Java _

RankUserSizeTimeDateStatistics
1teebee920.11232012/10/27 11:36:510B / 57B / 33B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*640.00012015/04/18 15:31:550B / 36B / 28B

C# _

RankUserSizeTimeDateStatistics
1teebee1160.05082012/10/28 10:34:160B / 78B / 34B

Chapel _

RankUserSizeTimeDateStatistics
1clock620.02302013/10/13 00:33:240B / 37B / 20B

Maxima _

RankUserSizeTimeDateStatistics
1clock680.40182012/10/29 07:23:070B / 43B / 24B
2teebee680.38542012/10/29 07:28:560B / 43B / 24B
3pooq770.74502012/10/05 01:00:510B / 53B / 23B

gnuplot _

RankUserSizeTimeDateStatistics
1*yuko*650.05102015/04/18 15:41:580B / 38B / 25B
2teebee730.02052013/12/28 09:40:140B / 35B / 37B

AWK _

RankUserSizeTimeDateStatistics
1teebee510.01262012/10/06 04:52:240B / 25B / 26B
2clock510.01302012/11/15 18:30:530B / 25B / 26B
3nn510.01282012/11/28 00:50:570B / 25B / 26B
4llhuii510.01262014/08/19 23:01:050B / ?B / ?B

sed _

RankUserSizeTimeDateStatistics
1tails1302.13932016/03/25 19:10:050B / 48B / 67B

jq _

RankUserSizeTimeDateStatistics
1clock460.03222015/02/10 00:13:080B / 31B / 15B
2teebee460.03452015/02/10 08:29:000B / 31B / 15B

bc _

RankUserSizeTimeDateStatistics
1teebee540.07562012/10/05 04:51:300B / 27B / 26B

dc _

RankUserSizeTimeDateStatistics
1*yuko*330.08542012/10/16 01:30:230B / 22B / 11B
2tails360.08132012/10/03 22:16:190B / 26B / 10B

xgawk _

RankUserSizeTimeDateStatistics
1llhuii510.01632014/08/19 23:01:180B / ?B / ?B
2teebee510.02802014/08/22 07:47:000B / 25B / 26B

R _

RankUserSizeTimeDateStatistics
1clock540.33042012/10/14 13:55:240B / 30B / 22B
2teebee540.24382012/10/14 16:38:070B / 30B / 22B
3pooq740.37992012/10/05 02:26:310B / 49B / 23B

QCL _

RankUserSizeTimeDateStatistics
1teebee830.09382012/10/06 17:37:300B / 56B / 16B
2pooq830.06642012/10/06 20:15:080B / 56B / 16B
3clock830.06772012/12/17 18:58:190B / 56B / 16B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs (cheat)2082.76392015/10/05 02:02:472B / 0B / 205B
2mitchs2242.67862014/12/08 12:00:440B / 0B / 224B
3g33k21870.00012013/01/29 14:20:03399B / ?B / ?B

Whitespace _

RankUserSizeTimeDateStatistics
1mitchs1340.19172015/03/24 11:29:350B / 0B / 0B

GolfScript _

RankUserSizeTimeDateStatistics
1tails230.19992012/10/03 22:06:100B / 7B / 16B
2clock230.20192012/10/07 05:14:590B / 8B / 15B
3twobit230.18392012/10/07 11:14:550B / 7B / 16B
4nooodl250.19132012/10/14 05:09:410B / ?B / ?B

gs2 _

RankUserSizeTimeDateStatistics
1mitchs90.13722015/01/16 07:28:412B / 3B / 4B
2clock90.17292015/01/17 02:44:272B / 2B / 5B
3nooodl110.19252014/09/20 23:30:203B / ?B / ?B

FlogScript _

RankUserSizeTimeDateStatistics
1milieu170.33192012/10/03 19:56:530B / ?B / ?B

Burlesque _

RankUserSizeTimeDateStatistics
1Hendrik190.10662014/10/07 11:08:470B / 13B / 6B
2teebee190.11572014/10/08 03:30:570B / 13B / 6B
3clock190.12132015/01/14 01:23:490B / 13B / 6B

Vim _

RankUserSizeTimeDateStatistics
1clock540.58362013/02/04 09:08:444B / 22B / 24B

Groovy _

RankUserSizeTimeDateStatistics
1teebee501.33542012/10/05 03:49:000B / 30B / 20B
2clock501.27172012/10/05 04:17:250B / 28B / 22B
3hoozie501.34152012/10/05 06:31:380B / 30B / 20B
4nn501.22112012/12/27 21:33:510B / 30B / 20B

Logo _

RankUserSizeTimeDateStatistics
1teebee480.11402012/10/04 16:24:230B / 32B / 9B
2clock480.10372013/01/31 14:10:230B / 30B / 13B

Language Ranking_

RankLangUserSizeScore
1gs2mitchs910000
2FlogScriptmilieu175294
3BurlesqueHendrik194736
4GolfScripttails233913
5Ktwobit253600
6JI., S.293103
7dc*yuko*332727
8A+teebee342647
9Perlllhuii372432
10Rubyclock402250
11Ruby2mitchs402250
12Iopooq432093
13PARI/GPteebee442045
14jqclock461956
15Logoteebee481875
16Groovyteebee501800
17AWKteebee511764
18xgawkllhuii511764
19Python3xsot531698
20bcteebee541666
21Rclock541666
22Arcteebee541666
23Vimclock541666
24Pythonxsot541666
25JavaScriptnn561607
26PHPteebee571578
27Xtalteebee581551
28REXX*yuko*601500
29Haskellhenkma621451
30Chapelclock621451
31Cnu631428
32Iconteebee641406
33Fortran*yuko*641406
34gnuplot*yuko*651384
35Maximaclock681323
36Piketeebee721250
37BASICteebee731232
38Smalltalkclock751200
39Luatwobit761184
40QCLteebee831084
41Prologpooq901000
42Javateebee92978
43Common LISPttmh98918
44SNOBOLclock101891
45Erlangteebee113796
46C#teebee116775
47sedtails130692
48Whitespacemitchs134671
49C++smkt157573
50Brainfuckmitchs (cheat)208432

return to the top page