Looking for reliable answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Discover the answers you need from a community of experts ready to help you with their knowledge and experience in various fields. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.
Sagot :
Hello,
In a diginacci sequence, all term is the sum off digits of the 2 terms before.
Answer: 2,3
[tex]u_{-2}=1\\u_{-1}=1\\u_0=digit(u_{-2})+digit(u_{-1})=1+1=2\\u_1=1+2=3\\u_2=2+3=5\\u_3=3+5=8\\u_4=5+8=13\\u_5=8+1+3=12\\...\\u_{18}=11\\u_{19}=8\\u_{20}=10\\u_{21}=9\\u_{22}=10\\u_{23}=10\\u_{24}=2**********\\u_{25}=3**********\\2020=24*84+4\\u_{2020}=u_{4}=13\\[/tex]
We must begin with 13 , 10
Proof:
Dim a As Long, b As Long, c As Long, nb As Integer
a = 13
b = 10
nb = 1
Print nb, a
While nb < 2021
nb = nb + 1
c = somme&(a, b)
a = b
b = c
' Print nb, a
Wend
Print nb, a
End
Function somme& (a1 As Long, b1 As Long)
Dim strA As String, strB As String, n As Long
strA = LTrim$(Str$(a1))
strB = LTrim$(Str$(b1))
n = 0
For i = 1 To Len(strA)
n = n + Val(Mid$(strA, i, 1))
Next i
For i = 1 To Len(strB)
n = n + Val(Mid$(strB, i, 1))
Next i
somme& = n
End Function
We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. Your visit means a lot to us. Don't hesitate to return for more reliable answers to any questions you may have. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.