<begin>
A student has a book containing 411 pages.
She read a certain number of pages on the first day and created a rule to work out how many pages she had to read on each succeeding day.
She decided that the number of pages to be read on the next day should be equal to the square of the sum of the digits of the page she ended at.
She found that on the sixth day, the number of pages she had set herself to read took her exactly to the final page of the book.
How many pages did she read on the 1st day?
<end>
The above puzzle comes from
a Cambridge University publication.
My question: list all the possibles scenarios , completing the book not necessarily in 6day period, but still adherring to her rules.
The following is based on a misreading of the rules. See my later comment.
The scenarios are listed below. The original question apparently was asking for 51 pages on the first day, 36 on the second day and 81 on each of the remaining four days, but 307 on the first day, followed by 100 on the second and then only one page on each of the four remaining days could have been a rather unusual schedule.
A couple of degenerate cases are all 411 on the first day or one page on each of 411 days.
The first entry on each row below is the first day's number of pages. That's followed by the number of days to total to complete the book. If that number of days is less than or equal to 10, the number of pages read on each of the days is spelled out on the remainder of the line.
1 411
8 242
10 402
17 233
19 294
26 224
28 285
35 215
37 276
44 206
46 267
51 6 51 36 81 81 81 81
53 197
55 258
56 5 56 121 16 49 169
62 188
64 249
71 179
73 240
80 170
82 231
91 222
100 312
107 143
109 204
116 134
118 195
125 125
127 186
132 5 132 36 81 81 81
134 116
136 177
143 107
145 168
152 98
154 159
161 89
163 150
170 80
172 141
181 132
186 2 186 225
190 123
206 44
208 105
213 4 213 36 81 81
215 35
217 96
224 26
226 87
233 17
235 78
242 8 242 64 100 1 1 1 1 1
244 69
253 60
262 51
271 42
280 33
290 2 290 121
307 6 307 100 1 1 1 1
411 1 411
DefDbl AZ
Dim crlf$, dailyread(1000)
Function mform$(x, t$)
a$ = Format$(x, t$)
If Len(a$) < Len(t$) Then a$ = Space$(Len(t$)  Len(a$)) & a$
mform$ = a$
End Function
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
For day1 = 1 To 411
d = 1: dread = day1: totread = day1
dailyread(1) = day1
Do Until totread >= 411
dr$ = LTrim(Str(dread))
sumdig = 0
For i = 1 To Len(dr)
sumdig = sumdig + Val(Mid(dr, i, 1))
Next
d = d + 1: dread = sumdig * sumdig: totread = totread + dread
dailyread(d) = dread
Loop
If totread = 411 Then
Text1.Text = Text1.Text & day1 & Str(d)
If d <= 10 Then
Text1.Text = Text1.Text & " "
For i = 1 To d
Text1.Text = Text1.Text & Str(dailyread(i))
Next
End If
Text1.Text = Text1.Text & crlf
End If
DoEvents
Next
End Sub
Edited on January 25, 2019, 12:54 pm

Posted by Charlie
on 20190125 09:08:22 