a=1;b=0;c=0;p=0; cycle:d=a*100+b*10+c;if( b==1or b==1 and c==1 , goto loop, goto next); loop:printd,", ",;p=p+1; next:c++;if(c<10, goto cycle, 0);c=0;b++;if(b<10, goto cycle, 0);b=0;c=0;a++;if(a<10, goto cycle,0);print"Total = ",p
OUTPUT:
1 - There are 18 2-digit "memorable" integers.
2 - There are 99 3-digit "memorable" integers.
(10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91, 101, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 131, 141, 151, 161, 171, 181, 191, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919) = 117 such numbers.