[Archive!] Pure mathematics, physics, chemistry, etc.: brain-training problems not related to trade in any way - page 322
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Я и на васике могу в четыре-пять строк уложиться
:)
I do. But it would be interesting to see...
No way...
And here's what the perl algorithm looks like:
for(111..999){
split(//,$_);
my($sum,$mul)=(0,1);
for(@_){$sum+=$_;$mul*=$_;}
print("$_\n") if($sum*12==$mul);
}
I've known BASIC for about 18 years. But what you have written I can't even understand. I don't know Perl. In general, in Basic it would be even easier if you could hide almost everything in a module, for example like this:
-
Private Sub Command1_Click()
Me.PrintList(MathMod.OtnProSum(1,1e5))
End Sub
He's just a programmer.... >> so-so.
I'll say more than that. He's not a programmer at all.
Верю. Но интересно было бы взглянуть...
;)
(10**(n-1)..10**n-1).each{|i|
sum=0;mul=1
(1..n).each{|s|
d=i%10**s/10**(s-1)
sum+=d;mul*=d
}
if mul/sum==12
print i,"\n"
end
}
А это, собсно, алгоритм счёта. "Чиста алгоритм" уместился в трёх строках, ежли не считать заголовок и закрывающий End функции :)
Cool!
Richie, in this case "exactly" is absolutely exact, with zero error: it is the equality for integers from the book on Diophantine equations.
Richie, but you can check on your Wasik if the equality "30 as a sum of three cubes" given on page 322 of the thread: https://c.mql4.com/forum/2010/04/cohen.GIF?
Richie, in this case "exactly" is absolutely exact, with zero error: it is the equality for integers from the book on Diophantine equations.
Unfortunately with standard data types like Double and Long nothing works. Now I regret that after graduation I destroyed the library of VB functions that allow me to do precise calculations with very large and very small numbers by creating my own data types in VB.
-
I tried it in VB with Double type - it turned out to be bullshit, in Excel it turned out to be zero.
The library worked simply - numbers were stored as strings of String type. Actions were performed on these strings after they were converted into the Byte format. If we had more time we could write again.
-
Maybe there is some other - tricky way of proving it?
Richie, but you can check on your Wasik if the equality "30 as a sum of three cubes" given on page 322 of the thread: https://c.mql4.com/forum/2010/04/cohen.GIF?
Richie, in this case "exactly" is absolutely exact, with zero error: it is the equality for integers from the book on Diophantine equations.
You can do the math in a Windows calculator.