Quote:
Originally Posted by alpaca9000
Hey kasturi, I have a list of numbers but I've found over 100 answers, When I add them in Excel i get a number in scientific notation, how many digits was ur answer?
|
There are actually over 32,000 answers... the sum of them is 806546892372
You can paste this code into an Excel macro/
VB window and run it to get the answer (this is the VBA "translation" for the pseudo-code I posted earlier):
Code:
Sub GetAnswer()
Cells(1, 1).Value = Div13Sum(0)
End Sub
Function Div13Sum(ByVal ValueToTest As Long) As Double
If ValueToTest < 999999 Then
For i = 1 To 8
Div13Sum = Div13Sum + Div13Sum((ValueToTest * 10) + i)
Next
Else
If ValueToTest Mod 13 = 0 Then
Div13Sum = ValueToTest
Else
Div13Sum = 0
End If
End If
End Function