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
5llhuii400.01002018/12/04 20:21:070B / 15B / 25B
6Histocrat520.06752016/06/21 22:31:410B / 22B / 30B
7yosio810.03542012/10/15 01:35:310B / ?B / ?B
8lynn21510.01642018/07/15 01:35:340B / 1746B / 405B

Ruby2 _

RankUserSizeTimeDateStatistics
1llhuii390.05912018/12/04 20:32:340B / 15B / 24B
2mitchs400.08322016/03/24 22:28:220B / 19B / 21B
3letranger470.08902019/04/07 17:25:290B / 23B / 24B
4lynn21510.06832018/07/15 01:35:450B / 1746B / 405B

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
5lynn21520.01592018/07/15 01:35:440B / 1751B / 401B

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
4xnor540.06852018/12/04 15:14:510B / 32B / 19B
5hallvabo550.17532012/10/03 21:08:010B / 34B / 19B
6teebee550.11522012/10/03 23:05:420B / 34B / 18B
7clock550.09532012/10/04 02:46:200B / 34B / 19B
8twobit550.18202012/10/07 10:51:540B / 34B / 18B
9recursive550.10322012/10/23 05:55:080B / 34B / 18B
10leonid550.10792013/01/05 13:02:360B / 34B / 18B
11Volatility550.15052013/03/18 09:01:340B / 34B / 19B
12lynn21520.04352018/07/15 01:35:500B / 1751B / 401B

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
5mypetlion560.28512018/01/03 04:58:170B / 34B / 21B

PHP _

RankUserSizeTimeDateStatistics
1teebee570.05302013/07/18 03:47:051B / 31B / 25B
2lynn17460.04962018/07/15 01:35:520B / 1347B / 0B

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

LilyPond _

RankUserSizeTimeDateStatistics
1lynn21550.52642018/07/15 01:35:350B / 1751B / 404B

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
4lynn21520.05752018/07/15 01:35:500B / 1751B / 401B

JavaScript _

RankUserSizeTimeDateStatistics
1nn560.02022012/12/27 21:32:440B / 31B / 25B
2teebee560.03792012/12/27 23:51:560B / 31B / 23B
3lynn21540.01572018/07/15 01:35:340B / 1751B / 403B

Lua _

RankUserSizeTimeDateStatistics
1tehtmi630.01972019/04/06 06:01:240B / 34B / 25B
2clock730.01242019/04/19 15:12:570B / 38B / 31B
3twobit760.02332012/10/07 10:56:280B / 48B / 22B
4lynn21520.01202018/07/15 01:35:340B / 1751B / 401B

Tcl _

RankUserSizeTimeDateStatistics
1clock640.04762019/01/31 21:25:460B / 35B / 18B
2lynn21520.01822018/07/15 01:35:330B / 1750B / 401B

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
4lynn21500.01862018/07/15 01:35:350B / 1747B / 403B

Crystal _

RankUserSizeTimeDateStatistics
1lynn21520.01242018/07/15 01:35:320B / 1750B / 401B

Kite _

RankUserSizeTimeDateStatistics
1lynn21540.01622018/07/15 01:35:440B / 1751B / 403B

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
4lynn21540.02302018/07/15 01:35:530B / 1751B / 403B

Cyan _

RankUserSizeTimeDateStatistics
1lynn21500.29582018/07/15 01:35:330B / 1749B / 401B

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
2lynn21580.01492018/07/15 01:35:320B / 1752B / 406B

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
4lynn21480.01352018/07/15 01:35:340B / 1746B / 402B

Perl6 _

RankUserSizeTimeDateStatistics
1lynn21511.61712018/07/15 01:35:510B / 1749B / 401B

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
4lynn21500.01302018/07/15 01:35:500B / 1747B / 403B

C _

RankUserSizeTimeDateStatistics
1nu630.01522012/10/06 01:37:580B / 33B / 30B
2llhuii630.00012018/01/04 16:43:430B / 33B / 30B
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
7lynn21620.00012018/07/15 01:35:440B / 1754B / 408B

C++ _

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

D _

RankUserSizeTimeDateStatistics
1lynn21680.01292018/07/15 01:35:530B / 1760B / 407B

Rust _

RankUserSizeTimeDateStatistics
1lynn21670.01412018/07/15 01:35:490B / 1757B / 409B

OCaml _

RankUserSizeTimeDateStatistics
1lynn21590.02382018/07/15 01:35:340B / 1757B / 402B

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
4lynn21580.01452018/07/15 01:35:430B / 1756B / 402B

ObjC _

RankUserSizeTimeDateStatistics
1lynn21620.00022018/07/15 01:35:440B / 1754B / 408B

Java _

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

Pascal _

RankUserSizeTimeDateStatistics
1lynn21640.01102018/07/15 01:35:500B / 1759B / 404B

Fortran _

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

C# _

RankUserSizeTimeDateStatistics
1teebee1160.05082012/10/28 10:34:160B / 78B / 34B
2lynn21990.03122018/07/15 01:35:360B / 1784B / 412B

Nemerle _

RankUserSizeTimeDateStatistics
1lynn21650.03062018/07/15 01:35:520B / 1760B / 405B

Curry _

RankUserSizeTimeDateStatistics
1lynn21580.00012018/07/15 01:35:450B / 1756B / 402B

Chapel _

RankUserSizeTimeDateStatistics
1clock580.00922019/03/16 17:07:100B / 33B / 22B

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
2teebee690.01032018/07/14 23:43:310B / 32B / 34B

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

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails430.48622018/12/05 16:18:560B / 17B / 23B
2llhuii430.04702019/01/01 19:37:550B / 19B / 22B

Zsh _

RankUserSizeTimeDateStatistics
1lynn21520.01832018/07/15 01:35:490B / 1750B / 401B

bc _

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

dc _

RankUserSizeTimeDateStatistics
1*yuko*330.08542012/10/16 01:30:230B / 22B / 11B
2tails330.05682018/01/04 18:15:500B / 22B / 11B

xgawk _

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

m4 _

RankUserSizeTimeDateStatistics
1lynn17460.01182018/07/15 01:35:520B / 1347B / 0B

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
5lynn21470.02452018/07/15 01:35:440B / 1746B / 401B

gs2 _

RankUserSizeTimeDateStatistics
1mitchs90.13722015/01/16 07:28:412B / 3B / 4B
2clock90.17292015/01/17 02:44:272B / 2B / 5B
3tails90.09502018/01/04 17:57:532B / 2B / 5B
4nooodl110.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
4lynn21490.02222018/07/15 01:35:340B / 1747B / 402B

Universal Lambda _

RankUserSizeTimeDateStatistics
1lynn17470.02692018/07/15 01:35:320B / 1347B / 0B

z80 _

RankUserSizeTimeDateStatistics
1lynn17580.01462018/07/15 01:35:507B / 1348B / 4B

Vim _

RankUserSizeTimeDateStatistics
1clock540.58362013/02/04 09:08:444B / 22B / 24B
2lynn17500.04812018/07/15 01:35:351B / 1350B / 0B

goruby _

RankUserSizeTimeDateStatistics
1lynn21500.02832018/07/15 01:35:340B / 1749B / 401B

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

Scala _

RankUserSizeTimeDateStatistics
1rotary-o472.13482019/05/03 01:58:432B / 25B / 18B
2Hendrik512.31352019/04/07 03:56:352B / 31B / 16B

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
10Ruby2llhuii392307
11Rubyclock402250
12Iopooq432093
13Bash (builtins)tails432093
14PARI/GPteebee442045
15jqclock461956
16Scalarotary-o471914
17Logoteebee481875
18Groovyteebee501800
19AWKteebee511764
20xgawkllhuii511764
21Python3xsot531698
22bcteebee541666
23Rclock541666
24Arcteebee541666
25Vimclock541666
26Pythonxsot541666
27JavaScriptnn561607
28PHPteebee571578
29Xtalteebee581551
30Chapelclock581551
31REXX*yuko*601500
32Haskellhenkma621451
33Cnu631428
34Luatehtmi631428
35Iconteebee641406
36Fortran*yuko*641406
37Tclclock641406
38gnuplot*yuko*651384
39Maximaclock681323
40Piketeebee721250
41BASICteebee731232
42Smalltalkclock751200
43QCLteebee831084
44Prologpooq901000
45Javateebee92978
46Common LISPttmh98918
47SNOBOLclock101891
48Erlangteebee113796
49C#teebee116775
50sedtails130692
51Whitespacemitchs134671
52C++smkt157573
53Brainfuckmitchs (cheat)208432
54m4lynn174651
55Universal Lambdalynn174751
56z80lynn175851
57Cyanlynn215041
58gorubylynn215041
59Perl6lynn215141
60Crystallynn215241
61Zshlynn215241
62Kitelynn215441
63LilyPondlynn215541
64Currylynn215841
65OCamllynn215941
66ObjClynn216241
67Pascallynn216441
68Nemerlelynn216541
69Rustlynn216741
70Dlynn216841

return to the top page