 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  An interesting recurrence (Posted on 2017-01-17) A sequence with the recurrence f(n)=3*f(n-1)+f(n-2) starts with two 1-digit numbers. The sequence contains the 8-digit number ABCDAECD. A≠0, and A, B, C, D, and E are not necessarily distinct. Find all possible values of ABCDAECD.

 No Solution Yet Submitted by Math Man Rating: 5.0000 (1 votes) Comments: ( Back to comment list | You must be logged in to post comments.) computer solution | Comment 2 of 5 | With A, B, C, D and E not necessarily being distinct:

`terms1 2   ABCDAECD`
`0 3   152917290 3   505051500 6   305834581 1   219322931 1   724374431 4   219322931 4   724374432 2   132811282 2   438645862 5   285728572 5   943697362 8   132811282 8   438645863 0   152917293 0   505051503 3   199216923 3   657968793 6   106617663 6   352134213 9   152917293 9   505051504 4   265622565 2   179110915 8   484945496 0   305834586 3   810886086 6   398433846 9   551351137 1   525157519 9   59765076`

There are 30 rows above but there are only 21 distinct values for ABCDAECD:

10661766
13281128
15291729
17911091
19921692
21932293
26562256
28572857
30583458
35213421
39843384
43864586
48494549
50505150
52515751
55135113
59765076
65796879
72437443
81088608
94369736

DefDbl A-Z
Dim crlf\$

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

For a = 0 To 9
For b = 0 To 9
x = a: y = b
While x < 100000000 And (x > 0 Or y > 0)
DoEvents
z = 3 * y + x
zs\$ = LTrim(Str(z))
If Len(zs) = 8 Then
If Mid(zs, 1, 1) = Mid(zs, 5, 1) And Mid(zs, 3, 1) = Mid(zs, 7, 1) And Mid(zs, 4, 1) = Mid(zs, 8, 1) Then
'  If Mid(zs, 1, 1) <> Mid(zs, 2, 1) And Mid(zs, 1, 1) <> Mid(zs, 3, 1) And Mid(zs, 1, 1) <> Mid(zs, 4, 1) Then
'  If Mid(zs, 2, 1) <> Mid(zs, 3, 1) And Mid(zs, 2, 1) <> Mid(zs, 4, 1) And Mid(zs, 2, 1) <> Mid(zs, 6, 1) And Mid(zs, 2, 1) <> Mid(zs, 6, 1)  Then
'    If Mid(zs, 3, 1) <> Mid(zs, 4, 1) And Mid(zs, 3, 1) <> Mid(zs, 6, 1)  Then
Text1.Text = Text1.Text & a & Str(b) & "   " & z & crlf
'    End If
'  End If
'  End If
End If
End If
x = y: y = z
Wend
Next b
Next a

Text1.Text = Text1.Text & crlf & " done"

End Sub

Notice the commented out code would make A, B, C, D and E necessarily distinct. With that code restored, to require distinct A, B, C, D and E, the results would be:

```0 3   15291729
0 6   30583458
2 2   43864586
2 5   94369736
2 8   43864586
3 0   15291729
3 3   65796879
3 6   35213421
3 9   15291729
6 0   30583458
9 9   59765076```

These are 7 distinct values:

15291729
30583458
35213421
43864586
59765076
65796879
94369736

Note that in many cases, a given starting pair, such as 1,4, will produce two different numbers in the same sequence that fit the pattern.

Edited on January 17, 2017, 11:34 am
 Posted by Charlie on 2017-01-17 11:20:42 Please log in:

 Search: Search body:
Forums (0)