
The mistake is using Java.





TRWTF is replying to an old message without reading the other responses first.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
 Sarah Hoyt





I wouldn't blame Java for this, it's probably more an issue with the IDE used to handle Java. In NetBeans I give my project names exactly the same name as the main class, and the package name is the same but all lower case as it must be = no issues. NetBeans did change the way it does all this stuff by default some years ago as I recall. Students often fail at this task, but with this simple convention nothing goes wrong.





There's an artwork by Nikolay BogdanovBelsky called Mental Arithmetic. In the Public School of S.Rachinsky, 1895  Nikolay BogdanovBelsky  WikiArt.org[^]
The interesting part is the task on the blackboard.
(10^{2} + 11^{2} + 12^{2} + 13^{2} + 14^{2})/365
Like the Russian boys, you have no calculator and no paper. Upvotes for:
1. A good reasoned guess at the answer
2. The exact answer, with an explanation of how you got it by mental arithmetic.
<edit> I should have expected you to brute force it in your heads. (You did do it without paper or calculator, right?)
So from now on I will upvote elegant solutions!</edit>
Wrong is evil and must be defeated.  Jeff Ello
Never stop dreaming  Freddie Kruger
modified 17Aug20 15:55pm.






Answer: 2 (ALL IN M'HEAD)
I pretty much know those squares by heart.
First 3 = 365 (already a hint): 1
Next two 169 + (2004) = 365: 1
1 + 1 = 2
Ravings en masse^ 

"The difference between genius and stupidity is that genius has its limits."  Albert Einstein  "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure."  Balboos HaGadol Mar 2010 






W∴ Balboos, GHB wrote: I pretty much know those squares by heart.
Obviously, why did I expect anything else.
Wrong is evil and must be defeated.  Jeff Ello
Never stop dreaming  Freddie Kruger





I did it the same way. But then, I'm an accountant, so.... Kind of a nerd asis.





Exactly the same thought process, and I also know the squares in my head  up to 16 anyway. Above that there's a bit of mental arithmetic required.





I was about to "guess" 2 based on the same premise: first three and a "feeling" about the last two (:

If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing
Which is stupid.





Everyone should know the squares  at least for 1 to 20. After that, you just need to know that multiples of ten are (x * 10)^2 = x^2 * 100. You can then do the halfways [numbers ending in 5] (x * 10 + 5)^2 = ((2x + 1) * 10)^2 / 4 [looks a lot more complicated than it is]; thereafter, for numbers ending in 1, 2, 6, 7 you apply (x + 1)^2 = x^2 + 2x + 1 (or x^2 + (x + 1) + x) [do it twice for 2 and 7] and for numbers ending in 3, 4, 8, 9 you apply (x  1)^2 = x^2  2x =1 or x^2  (x + 1)  x = x^2  x  x  1 [do it twice for 3 and 8]
At least, that's what I use! And I assure you, once you've got the hang of them that are simple.
Edit: It is also useful to memories powers of two and squares of prime numbers
modified 18Aug20 6:03am.





For those I don't know I use a binomial expansion in my head to make it easier. Not as quick as memorization (look up tables are always rather fast  even for computers).
So, if given 27 * 82 it would become (303)*(80+2)
Numbers to juggle mentally: +2400, 6, 240, +60
Corresponding to the outer two terms and the cross terms.
If you do it now and then it remains pretty efficient  but if you've not done it for a year or two it take some cobweb sweeping to set one's storage back to efficient levels.
2214
Ravings en masse^ 

"The difference between genius and stupidity is that genius has its limits."  Albert Einstein  "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure."  Balboos HaGadol Mar 2010 





It appears to me the problem is summing the terms of numerator  not multiplying them. Isn't that a '+' between the terms? That's a considerably easier problem and one I can probably manage.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"





You're quite correct, fixed it.
Wrong is evil and must be defeated.  Jeff Ello
Never stop dreaming  Freddie Kruger





About 160,000,000  my mental arithmetic runs out of registers to remember digits in after 5 or 6 digits ... and long division starts using 'em up fast ...
But some of it is easy: 10^{2}*11^{2}*12^{2}*13^{2}*14^{2} == 100 * 121 * 144 * 169 * 196
(10*10 is easy, and each square adds 2 more than the previous: 100 > 121 Adds 21, 121 > 144 adds 23, so the next two terms are 144 + 25 and 144 + 25 + 27)
We were rote taught our "times tables" up to 12 by 12, so the first three are imprinted on my brain...
long multiplication in your head is reasonably easy as long as you keep the decimal places straight.
[edit]
Oh, right, that's easier:
100 + 121 + 144 + 169 + 196 = 730
730 / 365 = 2
Easy peasy!
[/edit]
"I have no idea what I did, but I'm taking full credit for it."  ThisOldTony
"Common sense is so rare these days, it should be classified as a super power"  Random Tshirt
AntiTwitter: @DalekDave is now a follower!





"We can't stop here  this is bat country"  Hunter S Thompson  RIP





10^2 = 1 0*2 0^2 = 100
11^2 = 1 1*2 1^2 = 121
12^2 = 1 2*2 2^2 = 144
13^2 = 1 3*2 3^2 = 169
14^2 = 1 4*2 4^2 = 196 (the last term (16) carries the one over, so 4*2+1 = 9)
Add those up: 365 + 365
(365 + 365)/365 = (365/365) ((1 + 1)/1) = 1 * 2 = 2





Elegant way to do it.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.





I did not use a calculator or a notepad.
I've been working in JavaScript for too long. This is how I visualized it:result = 0.0;
for (i = 10; i < 15; i++) {
result += Math.pow(i, 2);
}
result = result / 365;
The question reminded me of writing my first basic programs to solve high school geometry and advanced math homework problems. (class of '85)
"Go forth into the source"  Neal Morse





(122)²+(121)²+12²+(12+1)²+(12+2)² using (a+b)² = a²+2ab+b² will cancel those 2ab.
Hence remains 5*12² + 2*4 + 2*1 = 5*146 = 10*73 = 730. Divided by 365 = 2.
So the exercise is indeed for the application of (a+b)²+(ab)² = 2a²+2b².
modified 18Aug20 2:46am.





Yeah!
This was my solution as well.
Wrong is evil and must be defeated.  Jeff Ello
Never stop dreaming  Freddie Kruger





Though one mistake, (a+b)² + (ab)² = 2a² + 2b². Good we are still as intelligent as then (?).
Probably the same trick the teacher would demonstrate. It would be interesting if some mathematician historian would check whether such tricks were indeed collected for instruction  of numerical math.





I did it almost the same way, but decided not to multiply 144 by 5, since I knew I was going to divide by 5, since 365 is dividable by 5. So:
((122)²+(121)²+12²+(12+1)²+(12+2)²)/365 = (144+(2*(2²+1²))/5)/(365/5) = (144+10/5)/73=146/73 = 2




