Numbers Whose Digits Add Up to n

Introduction

Numbers from 1 to 1,000 whose digits add up to n.

\\ PARI/GP
n = 1;
for (x = 1, 1000, if (vecsum(digits(x)) == n, print1(x, “, “)));

Digits Add Up to 1

1, 10, 100, 1000

Digits Add Up to 2

2, 11, 20, 101, 110, 200

Digits Add Up to 3

3, 12, 21, 30, 102, 111, 120, 201, 210, 300

Digits Add Up to 4

4, 13, 22, 31, 40, 103, 112, 121, 130, 202, 211, 220, 301, 310, 400

Digits Add Up to 5

5, 14, 23, 32, 41, 50, 104, 113, 122, 131, 140, 203, 212, 221, 230, 302, 311, 320, 401, 410, 500

Numbers from 1 to 1,000,000

5, 14, 23, 32, 41, 50, 104, 113, 122, 131, 140, 203, 212, 221, 230, 302, 311, 320, 401, 410, 500, 1004, 1013, 1022, 1031, 1040, 1103, 1112, 1121, 1130, 1202, 1211, 1220, 1301, 1310, 1400, 2003, 2012, 2021, 2030, 2102, 2111, 2120, 2201, 2210, 2300, 3002, 3011, 3020, 3101, 3110, 3200, 4001, 4010, 4100, 5000, 10004, 10013, 10022, 10031, 10040, 10103, 10112, 10121, 10130, 10202, 10211, 10220, 10301, 10310, 10400, 11003, 11012, 11021, 11030, 11102, 11111, 11120, 11201, 11210, 11300, 12002, 12011, 12020, 12101, 12110, 12200, 13001, 13010, 13100, 14000, 20003, 20012, 20021, 20030, 20102, 20111, 20120, 20201, 20210, 20300, 21002, 21011, 21020, 21101, 21110, 21200, 22001, 22010, 22100, 23000, 30002, 30011, 30020, 30101, 30110, 30200, 31001, 31010, 31100, 32000, 40001, 40010, 40100, 41000, 50000, 100004, 100013, 100022, 100031, 100040, 100103, 100112, 100121, 100130, 100202, 100211, 100220, 100301, 100310, 100400, 101003, 101012, 101021, 101030, 101102, 101111, 101120, 101201, 101210, 101300, 102002, 102011, 102020, 102101, 102110, 102200, 103001, 103010, 103100, 104000, 110003, 110012, 110021, 110030, 110102, 110111, 110120, 110201, 110210, 110300, 111002, 111011, 111020, 111101, 111110, 111200, 112001, 112010, 112100, 113000, 120002, 120011, 120020, 120101, 120110, 120200, 121001, 121010, 121100, 122000, 130001, 130010, 130100, 131000, 140000, 200003, 200012, 200021, 200030, 200102, 200111, 200120, 200201, 200210, 200300, 201002, 201011, 201020, 201101, 201110, 201200, 202001, 202010, 202100, 203000, 210002, 210011, 210020, 210101, 210110, 210200, 211001, 211010, 211100, 212000, 220001, 220010, 220100, 221000, 230000, 300002, 300011, 300020, 300101, 300110, 300200, 301001, 301010, 301100, 302000, 310001, 310010, 310100, 311000, 320000, 400001, 400010, 400100, 401000, 410000, 500000

Digits Add Up to 6

6, 15, 24, 33, 42, 51, 60, 105, 114, 123, 132, 141, 150, 204, 213, 222, 231, 240, 303, 312, 321, 330, 402, 411, 420, 501, 510, 600

Digits Add Up to 7

7, 16, 25, 34, 43, 52, 61, 70, 106, 115, 124, 133, 142, 151, 160, 205, 214, 223, 232, 241, 250, 304, 313, 322, 331, 340, 403, 412, 421, 430, 502, 511, 520, 601, 610, 700

Digits Add Up to 8

8, 17, 26, 35, 44, 53, 62, 71, 80, 107, 116, 125, 134, 143, 152, 161, 170, 206, 215, 224, 233, 242, 251, 260, 305, 314, 323, 332, 341, 350, 404, 413, 422, 431, 440, 503, 512, 521, 530, 602, 611, 620, 701, 710, 800

Digits Add Up to 9

9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 108, 117, 126, 135, 144, 153, 162, 171, 180, 207, 216, 225, 234, 243, 252, 261, 270, 306, 315, 324, 333, 342, 351, 360, 405, 414, 423, 432, 441, 450, 504, 513, 522, 531, 540, 603, 612, 621, 630, 702, 711, 720, 801, 810, 900

Digits Add Up to 10

19, 28, 37, 46, 55, 64, 73, 82, 91, 109, 118, 127, 136, 145, 154, 163, 172, 181, 190, 208, 217, 226, 235, 244, 253, 262, 271, 280, 307, 316, 325, 334, 343, 352, 361, 370, 406, 415, 424, 433, 442, 451, 460, 505, 514, 523, 532, 541, 550, 604, 613, 622, 631, 640, 703, 712, 721, 730, 802, 811, 820, 901, 910

Digits Add Up to 11

29, 38, 47, 56, 65, 74, 83, 92, 119, 128, 137, 146, 155, 164, 173, 182, 191, 209, 218, 227, 236, 245, 254, 263, 272, 281, 290, 308, 317, 326, 335, 344, 353, 362, 371, 380, 407, 416, 425, 434, 443, 452, 461, 470, 506, 515, 524, 533, 542, 551, 560, 605, 614, 623, 632, 641, 650, 704, 713, 722, 731, 740, 803, 812, 821, 830, 902, 911, 920

Digits Add Up to 12

39, 48, 57, 66, 75, 84, 93, 129, 138, 147, 156, 165, 174, 183, 192, 219, 228, 237, 246, 255, 264, 273, 282, 291, 309, 318, 327, 336, 345, 354, 363, 372, 381, 390, 408, 417, 426, 435, 444, 453, 462, 471, 480, 507, 516, 525, 534, 543, 552, 561, 570, 606, 615, 624, 633, 642, 651, 660, 705, 714, 723, 732, 741, 750, 804, 813, 822, 831, 840, 903, 912, 921, 930

Digits Add Up to 13

49, 58, 67, 76, 85, 94, 139, 148, 157, 166, 175, 184, 193, 229, 238, 247, 256, 265, 274, 283, 292, 319, 328, 337, 346, 355, 364, 373, 382, 391, 409, 418, 427, 436, 445, 454, 463, 472, 481, 490, 508, 517, 526, 535, 544, 553, 562, 571, 580, 607, 616, 625, 634, 643, 652, 661, 670, 706, 715, 724, 733, 742, 751, 760, 805, 814, 823, 832, 841, 850, 904, 913, 922, 931, 940

Digits Add Up to 14

59, 68, 77, 86, 95, 149, 158, 167, 176, 185, 194, 239, 248, 257, 266, 275, 284, 293, 329, 338, 347, 356, 365, 374, 383, 392, 419, 428, 437, 446, 455, 464, 473, 482, 491, 509, 518, 527, 536, 545, 554, 563, 572, 581, 590, 608, 617, 626, 635, 644, 653, 662, 671, 680, 707, 716, 725, 734, 743, 752, 761, 770, 806, 815, 824, 833, 842, 851, 860, 905, 914, 923, 932, 941, 950

Digits Add Up to 15

69, 78, 87, 96, 159, 168, 177, 186, 195, 249, 258, 267, 276, 285, 294, 339, 348, 357, 366, 375, 384, 393, 429, 438, 447, 456, 465, 474, 483, 492, 519, 528, 537, 546, 555, 564, 573, 582, 591, 609, 618, 627, 636, 645, 654, 663, 672, 681, 690, 708, 717, 726, 735, 744, 753, 762, 771, 780, 807, 816, 825, 834, 843, 852, 861, 870, 906, 915, 924, 933, 942, 951, 960

Digits Add Up to 16

79, 88, 97, 169, 178, 187, 196, 259, 268, 277, 286, 295, 349, 358, 367, 376, 385, 394, 439, 448, 457, 466, 475, 484, 493, 529, 538, 547, 556, 565, 574, 583, 592, 619, 628, 637, 646, 655, 664, 673, 682, 691, 709, 718, 727, 736, 745, 754, 763, 772, 781, 790, 808, 817, 826, 835, 844, 853, 862, 871, 880, 907, 916, 925, 934, 943, 952, 961, 970

Digits Add Up to 17

89, 98, 179, 188, 197, 269, 278, 287, 296, 359, 368, 377, 386, 395, 449, 458, 467, 476, 485, 494, 539, 548, 557, 566, 575, 584, 593, 629, 638, 647, 656, 665, 674, 683, 692, 719, 728, 737, 746, 755, 764, 773, 782, 791, 809, 818, 827, 836, 845, 854, 863, 872, 881, 890, 908, 917, 926, 935, 944, 953, 962, 971, 980

Digits Add Up to 18

99, 189, 198, 279, 288, 297, 369, 378, 387, 396, 459, 468, 477, 486, 495, 549, 558, 567, 576, 585, 594, 639, 648, 657, 666, 675, 684, 693, 729, 738, 747, 756, 765, 774, 783, 792, 819, 828, 837, 846, 855, 864, 873, 882, 891, 909, 918, 927, 936, 945, 954, 963, 972, 981, 990

Digits Add Up to 19

199, 289, 298, 379, 388, 397, 469, 478, 487, 496, 559, 568, 577, 586, 595, 649, 658, 667, 676, 685, 694, 739, 748, 757, 766, 775, 784, 793, 829, 838, 847, 856, 865, 874, 883, 892, 919, 928, 937, 946, 955, 964, 973, 982, 991

Digits Add Up to 20

299, 389, 398, 479, 488, 497, 569, 578, 587, 596, 659, 668, 677, 686, 695, 749, 758, 767, 776, 785, 794, 839, 848, 857, 866, 875, 884, 893, 929, 938, 947, 956, 965, 974, 983, 992

Digits Add Up to 21

399, 489, 498, 579, 588, 597, 669, 678, 687, 696, 759, 768, 777, 786, 795, 849, 858, 867, 876, 885, 894, 939, 948, 957, 966, 975, 984, 993

Digits Add Up to 22

499, 589, 598, 679, 688, 697, 769, 778, 787, 796, 859, 868, 877, 886, 895, 949, 958, 967, 976, 985, 994

Digits Add Up to 23

599, 689, 698, 779, 788, 797, 869, 878, 887, 896, 959, 968, 977, 986, 995

Digits Add Up to 24

699, 789, 798, 879, 888, 897, 969, 978, 987, 996

Digits Add Up to 25

799, 889, 898, 979, 988, 997

Digits Add Up to 26

899, 989, 998

Digits Add Up to 27

999

Digits Add Up to 28

There are no numbers from 1 to 1,000 that fit the pattern.

Leave a Reply