My Math Forum Formula for n^2 without explicitly performing n*n:

 Number Theory Number Theory Math Forum

 September 17th, 2018, 10:25 AM #11 Member   Joined: Feb 2013 From: London, England, UK Posts: 38 Thanks: 1 @Denis It's just a way of representing n^2 without doing n*n directly. @mrtwhs It got edited on MSE. I checked it initially and it worked, but I'll double check now, and see if it needs changing. I agree with Denis, it's got too many /2/2 's etc. Give me a few minutes.
 September 17th, 2018, 10:36 AM #12 Member   Joined: Feb 2013 From: London, England, UK Posts: 38 Thanks: 1 $$n^2 = [(1 - (-1)^n)/2] + [(1 + (-1)^n)/2] * [2*{n + (1 - (-1)^n)/2}] + [2*{n + (1 - (-1)^n)/2}] * [{n + (1 - (-1)^n)/2}/2 - 1]$$ I think this is correct now. Last edited by Jopus; September 17th, 2018 at 10:38 AM.
September 17th, 2018, 10:42 AM   #13
Math Team

Joined: Oct 2011

Posts: 14,597
Thanks: 1038

Quote:
 Originally Posted by Jopus $$n^2 = [(1 - (-1)^n)/2] + [(1 + (-1)^n)/2] * [2*{n + (1 - (-1)^n)/2}] + [2*{n + (1 - (-1)^n)/2}] * [{n + (1 - (-1)^n)/2}/2 - 1]$$ I think this is correct now.
Next step: let u = (-1)^n ; get my drift?

 September 17th, 2018, 10:45 AM #14 Member   Joined: Feb 2013 From: London, England, UK Posts: 38 Thanks: 1 Oh bummer Should be fixed finally now: $$n^2 = [(1 - (-1)^n)/2] + [(1 + (-1)^n)/2] * [2 * (n + (1 - (-1)^n)/2)] + [2 *(n + (1 - (-1)^n)/2)] * [((n + (1 - (-1)^n)/2)/2) - 1]$$
 September 17th, 2018, 10:48 AM #15 Member   Joined: Feb 2013 From: London, England, UK Posts: 38 Thanks: 1 @Denis, but if I have u = (-1)^n, then it just introduces another variable, when we don't need one. The entire right side is all in n. I agree, for presentation purposes, it simplifies things, which is what I did in the original posting.
September 17th, 2018, 11:44 AM   #16
Math Team

Joined: Oct 2011

Posts: 14,597
Thanks: 1038

Quote:
 Originally Posted by Jopus @Denis, but if I have u = (-1)^n, then it just introduces another variable, when we don't need one. The entire right side is all in n. I agree, for presentation purposes, it simplifies things, which is what I did in the original posting.
I mean to make the simplification process faster/easier.
Put the darn thing back in at the end.

Question: is n restricted to being an integer?

 September 17th, 2018, 11:59 AM #17 Member   Joined: Feb 2013 From: London, England, UK Posts: 38 Thanks: 1 @Denis, yes sorry n is always an integer. I mean, maybe it works with rational numbers, I'm not sure. I haven't checked so I don't know. But I'm only interested in the integers with my wider work, so I didn't check. I'll do so quickly now though. If you're looking for the simplification with s and t variables substituted for the most commonly occurring terms, it's there at the bottom of the first post.
September 17th, 2018, 12:14 PM   #18
Math Team

Joined: Oct 2011

Posts: 14,597
Thanks: 1038

Quote:
 Originally Posted by Jopus @Denis, yes sorry n is always an integer.
If that's the case, then (-1)^n is always equal to -1.
Then why not simply use -1 ?

 September 17th, 2018, 12:25 PM #19 Member   Joined: Feb 2013 From: London, England, UK Posts: 38 Thanks: 1 But (-1)^n is only equal to -1 when n is odd; when n is even, it becomes equal to plus 1, and this is the crux of the formula, because it cancels out some terms as it goes to zero, and other terms are not cancelled out since 1 -(-1)^(odd power) is equal to 2.
 September 17th, 2018, 12:35 PM #20 Math Team     Joined: May 2013 From: The Astral plane Posts: 2,274 Thanks: 943 Math Focus: Wibbly wobbly timey-wimey stuff. My two cents. Curiosity is a good thing but it's pretty easy to see why MSE shut it down. It's a nasty way to get around doing $\displaystyle n^2$. Perhaps you should have changed the topic to "can we do this" rather than "can we avoid calculating $\displaystyle n^2$ directly with a ridiculously complicated expression." If you get my meaning. I believe that calculators and computers are still using the logarithmic approach: $\displaystyle log_2(n^2) = 2 \cdot log_2(n)$. The advantage is using addition rather than multiplication. Of course you have to have tables for the logarithm built in which makes things worse, IMHO. With a bit of additional effort you could do this recursively: $\displaystyle n^2 = (n - 1)^2 + 2(n - 1)+ 3$. -Dan Thanks from Sebastian Garth, Denis and JeffM1

 Tags explicitly, formula, performing

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post velasco10 Advanced Statistics 1 November 24th, 2014 07:41 AM LordRaaa Algebra 3 May 15th, 2012 10:01 AM Alex1 Algebra 0 October 29th, 2010 05:38 PM agro Probability and Statistics 3 August 27th, 2009 06:17 AM wmoonw Algebra 1 January 16th, 2009 12:15 AM

 Contact - Home - Forums - Cryptocurrency Forum - Top