Sum Digits over Complete Blocks and Ranges
第21讲 数字和 · Lesson 21.2
Use balanced decimal blocks such as 00–99 and 000–999 instead of adding thousands of digit sums one number at a time. Then split any range into complete blocks and a short tail.
Read digit-sum notation precisely
The symbol s(n) means “add the decimal digits inside the numeral n.” It does not mean add all numbers from 1 through n.
Definition
Zeros still occupy places, but they add nothing to the digit sum.
Digit-sum scanner
Checkpoint
Need a hint for Mission 1?
Add digits inside the single numeral.
Check your method
s(307)=3+0+7; s(1000)=1; s(0)=0. 10;1;0;2+0+3.
Build a tiny frequency table
In 00–19, the ones digits 0–9 each appear twice, contributing 2×45=90. The tens digit is 0 ten times and 1 ten times, contributing 10. Total: 100. In 00–99, each digit appears ten times in each place, giving 2×10×45=900. To total L through U, subtract only 0 through L−1 from 0 through U; subtracting through L would remove an endpoint you need.
Balance the complete block 00–99
Writing leading zeroes makes every numeral the same width. In each place, every digit from 0 through 9 appears exactly ten times.
The worked example total
The worked example pairs 00 with 99, 01 with 98, and so on. Every pair has combined digit sum 18, and 50 pairs give:
Place-frequency view
| Place | Each digit appears | Digit contribution |
|---|---|---|
| Tens | 10 times | 10×45=450 |
| Ones | 10 times | 10×45=450 |
Explore one digit in one place
Checkpoint
Need a hint for Mission 2?
In 00–99, each digit appears ten times in each place.
Check your method
One entire place contributes10×(0+1+⋯+9)=450. Two places contribute900. 10;450;900;50 complement pairs.
Generalize to every complete decimal block
In all k-digit strings from 00…0 through 99…9, every digit appears equally often in every position.
Leading zeros are allowed in the display block. They do not change any digit sum.
Transfer: 1 through 1000
The block 000–999 totals 13,500. Then add s(1000)=1:
Checkpoint for k=3
Need a hint for Mission 3?
Use the fixed width k=3, even if the slider changes.
Check your method
There are1000 displays. Fixing one digit in one place leaves100 choices for the other places; across three places it occurs300 times. 1000;100;300;13500+s(1000)=13501.
Shift a complete block by fixing a prefix
A fixed prefix contributes the same digit sum to every number in the block. The variable suffix contributes a reusable complete-block total.
Example: 100 through 199
Fixed-prefix block laboratory
Checkpoint
Need a hint for Mission 4?
Separate the fixed starting digits from the varying last places.
Check your method
100–199 totals100+900;500–599 totals500+900;1000–1999 totals1000+13500. 1000;1400;14500;variable two-place total900.
Complete the worked example guided practice through 203
Split the range into two complete hundred-blocks and one short tail.
Extra practice
Find:
Rebuild the worked solution
Need a hint for Mission 5?
Use whole-number blocks, including203 in full.
Check your method
100–199 gives100+900=1000;200–203 gives2+3+4+5=14. 1000;14;900+1000+14=1914;100 numbers.
Use complete thousand-blocks for 1 through 2010
The practice problem looks long, but it contains two complete 1000-number blocks and only eleven final numbers.
original exercise
Find the sum of the digit sums of all positive whole numbers from 1 through 2010.
Complete the practice problem
Need a hint for Mission 6?
Use thousand-blocks and the eleven-number tail.
Check your method
2000–2009 contributes2+3+⋯+11=65;2010 contributes3. 13500;14500;68;28068.
Sum a structured subset: the even numbers 2–100
A subset can still be balanced. Organize the even numbers as 00, 02, 04, …, 98, then replace 00 with 100.
original exercise
Find the total of the digit sums of:
Tens contribution
Every tens digit 0–9 occurs five times.
Ones contribution
The cycle 0,2,4,6,8 occurs ten times.
Replace 00 by 100
s(00)=0 and s(100)=1.
Checkpoint
Need a hint for Mission 7?
First count the even displays00,02,…,98.
Check your method
Their tens contribute5×45=225; ones contribute10×20=200. Replace00 by100, adding1. 225;200;1;426.
Use a general range digit-sum laboratory
Include both endpoints L and U. If F(n) is the total of digit sums from 0 through n, the requested total is F(U)−F(L−1). For L=0 there is nothing to subtract. Subtracting F(L) would wrongly remove L.
Any whole-number range, including both endpoints
Independent range checks
Need a hint for Mission 8?
Include both endpoints. Split into complete blocks and short tails.
Check your method
345–349 contributes70;350–399 contributes150+350+225=725;400–599 contributes1300+1400=2700;600–678 contributes474+273+351=1098. 345–678 totals795+2700+1098=4593. For250–349:675+475=1150. Other answers:13501;28068.
Try a new problem before the workshop
Find the total of the digit sums from 95 through 104, including both endpoints.
Compare your reasoning after trying
For 95–99 the sums total 14+15+16+17+18=80. For 100–104 they total 1+2+3+4+5=15. Total: 95.
Independent workshop
Correct all eight answers to complete the workshop.
Need a hint for Mission 9?
Distinguish one numeral, a complete block, and a restricted range.
Check your method
The even-number range needs the extra contribution1 from100. 12;45;900;13500;13501;1000;426;28068.
Objective exit ticket
Answer all five correctly and complete the other nine missions to unlock the certificate.
Optional reflection — not automatically graded
Complete-Block Digit-Sum Architect
This certifies that Student completed all ten missions and can sum digits efficiently over complete decimal blocks, shifted blocks, and arbitrary ranges.
Chapter 21 • Digit Sums
Need a hint for Mission 10?
For the last item, add the four separate digit sums.
Check your method
s(98)+s(99)+s(100)+s(101)=17+18+1+2=38. 900;1000;1914;426;38.