Below are 2 different sequences, but the rules are the same,
2, 3, 3, 9, 9, ?
3, 7, 3, 3, 7, 9, ?
determine the two missing numbers and find the rule,
Bonus. how far can each sequence go? Can you find a longer sequence of numbers that follow the same rule?
list
10 for S=1 to 9
20 gosub *Build(S)
30 next
40 end
100 *Build(N)
101 local J
110 if nxtprm(N-1)=N then
120 :print N;:AnyDone=1
130 :for J=1 to 9 step 2
140 :gosub *Build(N*10+J)
150 :next
160 :if AnyDone=1 then print:AnyDone=0
170 return
OK
run
2 23 233 2333 23333
23339
2339 23399 233993 2339933 23399339
239 2393
2399 23993 239933 2399333
29 293 2939 29399 293999 2939999 29399999
3 31 311 3119 31193
313 3137 31379
317
37 373 3733 37337 373379 3733799 37337999
37339 373393
3739 37397
379 3793
3797
5 53
59 593 5939 59393 593933 5939333 59393339
59399 593993
599
7 71 719 7193 71933 719333
73 733 7331
7333 73331
739 7393 73939 739391 7393913 73939133
739393 7393931
7393933
739397
739399
79 797
OK
In those cases where a line begins with a number longer than one digit, the preceding numbers in that sequence can be found on some preceding line, as the new line is a new branch off from a prior line.
There are five of length 8: 23399339, 29399999, 37337999, 59393339, 73939133.
|
Posted by Charlie
on 2004-12-18 15:06:59 |