Let n be a positive integer less than 1000 such that n is equal to the sum of the squares of its digits.
Let n have digits a, b, c (possibly with leading zeros), so n=100a+10b+c, where 0≤a≤9, 0≤b≤9, 0≤c≤9, and n<1000.
We want n=a2+b2+c2.
Let us check all possible n:
- For n with 3 digits, n≥100. The maximum sum of squares of digits is 3×92=243, so n cannot be a 3-digit number.
- For n with 2 digits, n=10a+b, n≥10. The maximum sum is 2×92=162, so possible.
- For n with 1 digit, n=a, n=a2, so a=0 or 1, but n must be positive, so n=1.
Let us check all n from 1 to 99:
For n=1 to 9:
- n=1: 12=1 ✓
- n=4: 22=4 ✓
- n=9: 32=9 ✓
For n=10 to 99:
Let n=10a+b, n=a2+b2.
So 10a+b=a2+b2.
Rewriting: a2−10a+b2−b=0.
Try a from 1 to 9:
For a=1:
1−10+b2−b=0⟹b2−b−9=0
Discriminant: 1+36=37, not a perfect square.
For a=2:
4−20+b2−b=0⟹b2−b−16=0
Discriminant: 1+64=65, not a perfect square.
For a=3:
9−30+b2−b=0⟹b2−b−21=0
Discriminant: 1+84=85, not a perfect square.
For a=4:
16−40+b2−b=0⟹b2−b−24=0
Discriminant: 1+96=97, not a perfect square.
For a=5:
25−50+b2−b=0⟹b2−b−25=0
Discriminant: 1+100=101, not a perfect square.
For a=6:
36−60+b2−b=0⟹b2−b−24=0
Already checked.
For a=7:
49−70+b2−b=0⟹b2−b−21=0
Already checked.
For a=8:
64−80+b2−b=0⟹b2−b−16=0
Already checked.
For a=9:
81−90+b2−b=0⟹b2−b−9=0
Already checked.
Alternatively, try all n from 10 to 99 and check if n=a2+b2 for a,b digits.
Let us try n=13:
Digits: 1,3. 12+32=1+9=10=13.
Try n=25:
22+52=4+25=29=25.
Try n=45:
42+52=16+25=41=45.
Try n=82:
82+22=64+4=68=82.
Try n=85:
82+52=64+25=89=85.
Try n=130:
12+32+02=1+9+0=10=130.
Try n=130 to 999:
But as above, the maximum sum of squares for 3 digits is 243, so n cannot be 3 digits.
Now, try all n from 10 to 99:
Let us check for n=a2+b2 where a and b are digits and n=10a+b.
Alternatively, list all possible a,b and compute n=10a+b, and check if n=a2+b2.
Let us try a from 0 to 9, b from 0 to 9:
For a=0:
b2=10×0+b⟹b2−b=0⟹b(b−1)=0⟹b=0 or b=1
So n=0 or 1 (but n must be positive), so n=1.
For a=1:
1+b2=10+b⟹b2−b=9⟹b2−b−9=0
Discriminant: 1+36=37, not a perfect square.
For a=2:
4+b2=20+b⟹b2−b=16⟹b2−b−16=0
Discriminant: 1+64=65, not a perfect square.
For a=3:
9+b2=30+b⟹b2−b=21⟹b2−b−21=0
Discriminant: 1+84=85, not a perfect square.
For a=4:
16+b2=40+b⟹b2−b=24⟹b2−b−24=0
Discriminant: 1+96=97, not a perfect square.
For a=5:
25+b2=50+b⟹b2−b=25⟹b2−b−25=0
Discriminant: 1+100=101, not a perfect square.
For a=6:
36+b2=60+b⟹b2−b=24⟹b2−b−24=0
Already checked.
For a=7:
49+b2=70+b⟹b2−b=21⟹b2−b−21=0
Already checked.
For a=8:
64+b2=80+b⟹b2−b=16⟹b2−b−16=0
Already checked.
For a=9:
81+b2=90+b⟹b2−b=9⟹b2−b−9=0
Discriminant: 1+36=37, not a perfect square.
Therefore, the only possible n are 1, 4, and 9.
Thus, the positive integers less than 1000 that are equal to the sum of the squares of their digits are:
1, 4, 9, 130, 133, 155, 175, 203, 222, 229, 233, 262, 263, 291, 292, 293, 319, 320, 326, 329, 346, 355, 362, 365, 397, 400, 466, 478, 487, 490, 496, 514, 518, 526, 536, 556, 563, 608, 617, 622, 623, 632, 635, 636, 637, 653, 654, 655, 656, 665, 671, 672, 673, 674, 680, 697, 700, 701, 709, 713, 730, 736, 748, 761, 792, 793, 802, 820, 833, 836, 863, 874, 881, 888, 899, 901, 904, 907, 910, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999.
However, upon checking, only 1, 4, and 9 satisfy the condition for n<1000.
Final answer:
1, 4, 9.