Wayback Machine
Dec JAN Feb
Previous capture 13 Next capture
2015 2016 2017
2 captures
13 Jan 16 - 13 Jan 16
sparklines
Close Help
jump to content
my subreddits
more »
Want to join? Log in or sign up in seconds.|
[-]
use the following search parameters to narrow your results:
subreddit:subreddit
find submissions in "subreddit"
author:username
find submissions by "username"
site:example.com
find submissions from "example.com"
url:text
search for "text" in url
selftext:text
search for "text" in self post contents
self:yes (or self:no)
include (or exclude) self posts
nsfw:yes (or nsfw:no)
include (or exclude) results marked as NSFW
e.g. subreddit:aww site:imgur.com dog
this post was submitted on
1,689 points (90% upvoted)
shortlink:
reset password

YouShouldKnow

subscribeunsubscribe496,790 Know-It-Alls readers
930 Know-It-Alls here now users here now
A community to share tips and tricks that will help yourself improve on activities, skills and various other tasks.
YSKs are about self-improvement on how to do things, not for facts and figures, which is what /r/TodayILearned is for. Look here for some thoughts about difference between a YSK and a TIL.
Citations are required for YSKs regarding health and science related topics.

Rules

  • 1) Your post MUST begin with YSK and have appropriate flair
  • 2) Within your post you must include "WHY" we should know this and promote discussion of the YSK.
  • 3) YSKs regarding Reddit, Facebook, Twitter or any other social media are NOT ALLOWED.
  • 4) YSKs with referral links to sites such as Copy, Dropbox, or Amazon are NOT ALLOWED.
  • 5) YSKs regarding ideas or concepts based in conspiracy will be removed at the discretion of the moderators
  • 6) YSKs that are a call to arms, which can be asking for support for charities, organizations or political parties WILL NOT BE ALLOWED.
  • 7) This subreddit is not the place to be self-advertising your websites, products and services. YSKs that are spamming websites, products and services will be dealt with at the discretion of the moderators and may result in action against the user posting the YSK.
  • 8) YSKs regarding computer shortcuts are no longer allowed as of June 2, 2014. It is advised that you use the search function in this subreddit or any other technology based subreddit to search for posts containing shortcuts for your OS

Categories


Related


Popular Posts

created by PhilxBeforea community for
1688
1689
1690
submitted by MisterHandy
Obvious:
1 - Always.
2 - If the number is even.
5 - If the number ends in 5 or 0.
10 - If the numbers ends in 0.
Less Obvious:
3 - Add all of the digits in the number. If the result is divisible by 3, then so is the original number. (Note that this rule can be repeated with the result if you still don't know.)
4 - If the last 2 digits of the number are divisible by 4, then so is the entire number. If you don't know then halve the last 2 digits twice. If you still have a whole number then it is divisible by 4.
6 - If the number passes the '2' rule and the '3' rule, then, yes.
8 - If the last 3 digits of the number are divisible by 8, then so is the entire number. If you don't know then halve the last 3 digits three times. If you still have a whole number then it is divisible by 8.
9 - Add all of the digits in the number. If the result is divisible by 9, then so is the original number. (Note that this rule can be repeated with the result if you still don't know.)
Obscure:
7 - Remove the last digit from the number. Take the number formed by the remaining digits and subtract by 2x the removed digit. If the result is divisible by 7, then so is the original number.
Example (889):
88-(9x2) = 88-18 = 70
=> 889 is divisible by 7.
all 126 comments
[–]ManipulativeOrg 254 points255 points256 points  (40 children)
bangs head repeatedly on desk
n % x == 0
[–]usrname_checks_out 44 points45 points46 points  (5 children)
I know banging your head on the wall burns 150 calories per hour. Not sure about desks.
[–]ManipulativeOrg 12 points13 points14 points  (0 children)
More I would imagine as, technically, I'm doing crunches!
[–]tensorstrength 2 points3 points4 points  (0 children)
Do we have a data scientist in the room?
[–]Ghosttwo 1 point2 points3 points  (1 child)
Falling from space burns about 100,000 calories in five minutes.
[–]norsurfit -1 points0 points1 point  (0 children)
What about banging your mom?
[–]thirtygoddamndicks 13 points14 points15 points  (0 children)
I hope OP's post isn't the original logic behind the modulo operator.
[–]HarryWragg 8 points9 points10 points  (23 children)
What are we talking about here?
[–]Trekky0623 22 points23 points24 points  (22 children)
In many programming languages, % is the modulus operator, i.e. it returns the remainder of a division operation. So, for example, 13 % 4 == 1, because 13 divided by 4 is 3 with remainder 1. n % x == 0, then n is divisible by x, because the remainder is 0.
[+]stdiodoth comment score below threshold-56 points-55 points-54 points  (21 children)
Just a single = will suffice. == is used to check equality of both sides of the expression.
[–]synackbar 20 points21 points22 points  (0 children)
A single equal sign is typically used for assignment. Assigning what's on the right to what is on the left, not for checking equality.
[–]tmnvex 11 points12 points13 points  (7 children)
The point of the statement is to check equality of both sides so '==' is necessary (i.e. 12 % 4 == 0 is true, while 13 % 4 == 0 is false).
[+]stdiodoth comment score below threshold-17 points-16 points-15 points  (6 children)
Nope. The person is not checking equality except in the last sentence.
"13%4 == 1 returns true" would have been a better way to word it.
In a normal context, it's better saying 13%4=1.
[–]1234yawaworht 5 points6 points7 points  (3 children)
But in a programming context "==" is usually read as "is equal to" which makes more sense in this situation.
[–]neurorgasm -1 points0 points1 point  (2 children)
Am I the only one that's more annoyed it wasn't ===? Is that just a js thing?
[–]wallstop 1 point2 points3 points  (0 children)
That's just a js thing due to language (pick one: deficiencies/design)
[–]Kaell311 0 points1 point2 points  (0 children)
Yes. Pretty much.
[–]morganmachine91 1 point2 points3 points  (0 children)
N % x = 0 is invalid syntax, doesn't make any sense. You could do something like x = n % 0, but that would have an entirely different meaning than what the original poster was saying.
n % x == 0 is an expression that returns true if n is divisible by x. n % x = 0 may not throw a compiler error in every language, but it's meaningless nonetheless.
[–]Kaell311 0 points1 point2 points  (0 children)
In a "normal" non programming context, % is percentage, not a modulus operator.
[–]snarkhunter 2 points3 points4 points  (11 children)
... as opposed to checking the equality of only one side of the expression?
[+]stdiodoth comment score below threshold-8 points-7 points-6 points  (10 children)
== returns 1 (true) or 0 (false).
= means assignment (in a programming context) or equal to (LHS = RHS in a normal, mathematical context).
[–]Kaell311 4 points5 points6 points  (8 children)
Then what was that bit about "on both sides" about??
[–]neurorgasm 1 point2 points3 points  (5 children)
x = 2
the variable x is set to 2
x == 3
false
x = 3
x is now equal to 3. Nothing to do with checking anything.
No idea what his point here is. Don't do drugs kids.
[–]FlyingPasta 0 points1 point2 points  (4 children)
I did drugs and still got it, shouldn't be so hard to understand.
[–]Kaell311 1 point2 points3 points  (3 children)
So what was his original point? When he said you only need one equals (implicit: because) two means check for equality on both sides.
How is checking for "equality on both sides" not what we want? And what does one equal do that's different from checking equality "on both sides" when it's used as a comparison operator?
[+]stdiodoth comment score below threshold-6 points-5 points-4 points  (1 child)
Checks for equality on both sides, then returns true or false.
[–]Kaell311 1 point2 points3 points  (0 children)
Right, as opposed to checking for equality, not on both sides? On one side?
[–]snarkhunter 2 points3 points4 points  (0 children)
I cannot, off the top of my head, think of many languages where "=" acts as both the assignment and equality operation. And that's the weirdest thing is that you're talking about syntax as if there are any universal laws whatsoever regarding the cosmetic details of programming languages.
[–]alex3omg 4 points5 points6 points  (0 children)
It's easy to remember, because it spells... AIIIAIIIAR...E..
[+][deleted]  (3 children)
[deleted]
    [–]ManipulativeOrg 0 points1 point2 points  (2 children)
    Hmm? Work into what exactly?
    [–]shiraz410 -2 points-1 points0 points  (1 child)
    Understanding these division rules?
    [–]ManipulativeOrg 0 points1 point2 points  (0 children)
    ...you think I do not understand them? Excuse me for assuming that you must not understand my post. I am trained and work as a physicist. (Math comes into play now and again in my field, if that needs explaining also.) My head banging is over how unneeded and pointless these are! The ideal, when it comes to maths, is simple elegance. Thanks for the kind words about my mother but the adults are having a conversation here, run along.
    [+]matmsl14 comment score below threshold-9 points-8 points-7 points  (3 children)
    E = M * 8==D 2
    [–]ChosenGSR 2 points3 points4 points  (0 children)
    Nice hammer
    [–]usrname_checks_out 0 points1 point2 points  (1 child)
    Well as long as we aren't taking the integral of ex to equate with f(u)n
    [–]ValorCat 0 points1 point2 points  (0 children)
    That's f(u)n + C!
    [–]exoticmind 45 points46 points47 points  (3 children)
    Also 11
    Subtract the sum of the even digits (in position) from the sum of the odd digits and divide that number by 11.
    Example (9685423)
    (9+8+4+3)-(6+5+2) = 24-13 = 11
    => 9685423 is divisible by 11.
    A little more on 11: To multiple a two-digit number by 11 add the two digits and stick that in the middle. If the sum is more than 9 add one to the hundreds.
    Example (89*11):
    8+9=17
    8 17 9 => 979
    [–]futilitarian 27 points28 points29 points  (0 children)
    I always just multiply by 10 then add the other number:
    (89*11) = (89*10)+89 = 890+89 = 979
    [–]SamsquamtchHunter 9 points10 points11 points  (0 children)
    Seems much easier to just divide by 11
    [–]lanemik 10 points11 points12 points  (0 children)
    also
    12 = 1
    112 = 121
    1112 = 12321
    11112 = 1234321
    111112 = 123454321
    1111112 = 12345654321
    ...
    [–]punking_funk 86 points87 points88 points  (21 children)
    Damn the one for 7 is completely new to me. Definitely gonna be useful
    [–]CranialFlatulence 42 points43 points44 points  (14 children)
    Math teacher here ...also didn't know a rule for 7 existed.
    [–]ManipulativeOrg 12 points13 points14 points  (9 children)
    Interested in the exceptions?
    [–]bunchesofoats 9 points10 points11 points  (8 children)
    Like 21?
    [–]jtl94 23 points24 points25 points  (7 children)
    2-(1x2) = 0 which is divisible by 7, so not an exception.
    [–]bunchesofoats 13 points14 points15 points  (1 child)
    I hadn't seen it like that. Thanks for pointing it out.
    [–]jtl94 8 points9 points10 points  (0 children)
    No problem :) thanks for not being grumpy about it.
    [–]ejnotts 7 points8 points9 points  (4 children)
    Hey, how is 0 divisible by 7? (Maybe I should have paid more attention in school!)
    [–]jtl94 7 points8 points9 points  (0 children)
    Another way of thinking about divisibility is this: x is evenly divisible by y if, when x is divided by y, there is no remainder. When 35 is divided by 7, there is no remainder, so 35 is evenly divisible by 7. When dividing zero by any number, the result is zero, with no remainder. Thus, by the definition of divisibility, zero is divisible by everything.
    Quoted from here because it's just something I know, but not exactly how to explain.
    I do remember my math professor last semester explaining it something like this: If you have zero groups of apples, how many groups can you evenly divide it into? It doesn't matter because there is nothing to divide. So you can divide zero apples among fifty people and everyone gets exactly the same amount of apple, none.
    [–]the_original_kiki 13 points14 points15 points  (0 children)
    Any number divides 0 except 0.
    [–]fries_in_a_cup 4 points5 points6 points  (0 children)
    7 * 0 = 0, so if you use some basic algebra rules, 0/7 = 0. Seven goes into zero exactly zero times.
    [–]undeadfred95 3 points4 points5 points  (0 children)
    If you have 0 pencils you can share them evenly with 7 people. Don't divide by 0 though. It is undefined.
    [–]the_original_kiki 1 point2 points3 points  (1 child)
    There's a rule for 11 as well.
    [–]CranialFlatulence 1 point2 points3 points  (0 children)
    WHERE WILL THE INSANITY END?!?!?!?!
    [–]SexualPie 0 points1 point2 points  (0 children)
    what level?
    [–]Jester_Don 10 points11 points12 points  (0 children)
    New to me as well but honestly I think it's easier to keep subtracting multiples of 7 you know from the number and see if you can end up with another multiple of 7 you already know.
    Take the 889 example for instance - okay, so I know 700 is a multiple of 7, so I can take that off to get 189, I also know 140 is a multiple of 7 so taking that off is 49, oh hey, that's 7*7! So 889 must be a multiple of 7.
    [–]StewieNZ 0 points1 point2 points  (0 children)
    If anyone is curious why this works, it is because for any xyz (each letter representing a digit, the same logic goes to higher digits) divisible by 7.
    Then if we add 7, if the last digit (z) is 0-2 then only this digit changes, so our formula is xy-2(z+7)=xy-2z-14, so remains divisible by seven.
    If the last digit is something else then z decreases by 3 and 'xy' increases by 1 so we get xy+1-2(z-3)=xy-2z+7, again remaining divisible by seven.
    This is a quick and messy explanation, but yeah.
    [–]Wiggity_Wooty_PM_Dat -1 points0 points1 point  (2 children)
    How is that useful?
    [–]Deanlechanger 2 points3 points4 points  (0 children)
    Not necessarily useful but I and I'm guessing many of us were taught in school that there wasn't a rule for 7, so this is cool
    [–]anhero23 0 points1 point2 points  (0 children)
    I could think of a few coding tools useful to videogame and/or data analysis design that could use these number tricks.
    [–]SexualPie -1 points0 points1 point  (0 children)
    yea thats insane
    [–]curiousbutton 13 points14 points15 points  (4 children)
    General rule of thumb:
    You cannot divide by 0
    [–]jk3us 0 points1 point2 points  (2 children)
    Or put "Google" into Google. Same result.
    [–]entp_adrone 4 points5 points6 points  (1 child)
    In all honesty I do this very often.
    [–]Fwhqgads 0 points1 point2 points  (0 children)
    But mostly because I honestly don't want to do that research paper right now.
    [–]Swaqqalicious 0 points1 point2 points  (0 children)
    B..but... muh infinity! /s
    [–]elquimico 10 points11 points12 points  (3 children)
    19 has always been my favorite. Very similar to 7, except you remove the last digit, multiply by 2, then add it back to the remaining number.
    Example (19)
    1+2(9) = 1+18 = 19
    Example(437)
    43+2(7) = 43+14 = 57
    5+2(7) = 19
    [–]ELaskanator 5 points6 points7 points  (2 children)
    I'm sure there is a general algorithm for any test factor which is congruent to +/- 1 in base 10 (i.e. 1, 9, 11, 19, 21, 29, 31, ...).
    [–]sd522527 1 point2 points3 points  (0 children)
    Actually, there is always a similar test for any number coprime to 10
    [–]elquimico 0 points1 point2 points  (0 children)
    You're probably right. You can come up with one for 29 along similar lines where you take last digit and multiply by 3 and add to remaining digit.
    Example(29)
    2 + 3(9) = 29
    Example(522)
    52 + 3(2) = 58
    5 + 3(8) = 29
    Edit: This also leads to an alternative to 9.
    Example(1,125)
    112 + 1(5) = 117
    11 + 1(7) = 18
    1 + 1(8) = 9
    [–]808dent 8 points9 points10 points  (1 child)
    8 - If the last 3 digits of the number are divisible by 8, then so is the entire number. If you don't know then halve the last 3 digits three times. If you still have a whole number then it is divisible by 8.
    Fuck. You beat my method.
    Mine was... If theres an even number in the hundreds place perform the 4 test but with 8, if there's an odd number then add or subtract 4 and then do the test
    [–]Screye 10 points11 points12 points  (0 children)
    The fact that you invented your own method, is a pretty big achievement in itself.
    Good stuff m8
    [–]ammicha 5 points6 points7 points  (0 children)
    And here are proofs for all the rules :).
    Proof of the 3 rule: Represent our number as a_1 + 10 a_2 + ... + 10n a_n. We have a_1 + 10 a_2 + ... + 10n a_n = 0 mod 3 iff a_1 + a_2 + ... + a_n = 0 mod 3, because 10k = 1 mod 3. So the number is divisible by 3 iff the sum of its digits are.
    Proof of the 4 rule: represent our number as 100x+10y+z, where y and z are the last 2 digits. Since 100 is divisible by 4, we have that the entire number is divisible by 4 iff 10y+z is.
    Proof of the 6 rule: Since 6=3*2, a number is divisible by 6 iff it is divisible by both 2 and 3. So we apply both rules 2 and 3.
    Proof of the 7 rule: Let our number be represented as 10x+y. So the number, after removing the last digit and subtracting it twice from the result, equals x-2y. We need to show that 7|10x+y iff 7|x-2y. But this is true, since x - 2y = 0 mod 7 <-> x+5y = 0 mod 7 <-> 10x+50y = 0 mod 7 <-> 10x+y = 0 mod 7, using the facts 7x = 7y = 0 mod 7. (The notation a|b means "a divides b").
    Proof of the 8 rule: Since 1000 is divisible by 8 (equaling 125), the same proof as in the rule for 4 applies, but for the last 3 digits instead of the last 2.
    Proof of the 9 rule: Same as for rule 3, noting that 10k = 1 mod 9.
    [–]DallasStarsFan-SA 6 points7 points8 points  (1 child)
    As an actuary major, this is super nice and helpful. Thanks
    [–]yawetag12 -5 points-4 points-3 points  (0 children)
    Wouldn't it just be easier and quicker to grab the calculator next to you?
    Then again, a true actuary would develop a spreadsheet to do it for them.
    [–]theunstopable_cam 6 points7 points8 points  (0 children)
    For nine if you add everything together over and over it eventually turns into nine
    [–]fireattack 37 points38 points39 points  (9 children)
    It's very interesting and educational but.. why we should know this?
    [–]BrainArrow 21 points22 points23 points  (1 child)
    Beware the job-stealing calculators
    [–]tensorstrength 5 points6 points7 points  (0 children)
    Does that make Texas Instruments Mexico?
    [–]KingCHAWLZ 46 points47 points48 points  (3 children)
    Math is a universally important skill.
    [–]avtrisal 7 points8 points9 points  (0 children)
    Math is important, these are just random facts about numbers.
    [–]Kaell311 3 points4 points5 points  (0 children)
    This is not.
    [–]esdf0 0 points1 point2 points  (0 children)
    As a mathematician I have to say that memorizing OP's rules is a fucking waste of time. It's not even proper math, just calculus. (I.e. stuff you can use a fucking calculator for.)
    Proving OP's rules, now that would be math, and by doing so you might actually learn something.
    But of course it's far easier to memorize useless stuff and then feel smart or something.
    [–]GobtheCyberPunk 11 points12 points13 points  (0 children)
    I'm currently studying for the GMAT and all of these (minus the one for 7, it's too cumbersome to be useful) are extremely useful for problems that involve quickly determining the factors of large numbers, as well as functions that have patterns every x numbers.
    [–]socratessue 1 point2 points3 points  (1 child)
    Accounting.
    [–]Kaell311 0 points1 point2 points  (0 children)
    Accounting after the fall of civilization?
    [–]nicocappa 33 points34 points35 points  (12 children)
    My way:
    1.) Pull out calculator
    2.) Divide by number you're trying to see if it's divisible by
    [+]Because_Bot_Fed comment score below threshold-12 points-11 points-10 points  (9 children)
    This deserves way more upvotes.
    I feel like impractical stuff like this would make it to the frontpage even if half of it were made up and wrong just because it seems like one of those interesting "huh, that work!" type things.
    [–]ManipulativeOrg 4 points5 points6 points  (0 children)
    There are numerous exceptions.
    [–]Screye 5 points6 points7 points  (6 children)
    I used to be like you.
    But, in math, knowing a few nifty skills at throwaway effort, is always a good deal.
    Granted that the value for swift calculations has reduced over time, it is still quite useful nevertheless.
    Source: am engineer, entrance exams are a BITCH.
    [–]Because_Bot_Fed 5 points6 points7 points  (5 children)
    Serious question for stuff that amounts to "this test for this career doesn't allow calculators" -- are "people like me" wrong or is the test and curriculum wrong?
    At what point do we say "it's the year 2794, we have calculators built into our brain. Maybe we should stop requiring students to turn off their math chip to learn this the manual long way"?
    Surely the foundational knowledge is worth keeping and having at some level, but just maybe....not -everyone- needs this crap as "standard"?
    [–]Screye 5 points6 points7 points  (2 children)
    Haha, if I had seen this post 4 years ago, my reply would have been "you are god damn right", and even today, you really are.
    But, reality doesn't function that way. Whether you like it or not, your resume will be a huge factor in getting a job, and getting good grades will require you to learn a ton of useless skills that don't matter in real life.
    Rather than quibbling about how things need to different, sometimes you gotta suck it up and learn/do useless stuff. Surprising, this is also the most useful skill when working. Your company and boss will implement a lot of redundant rules. You get to choose to follow them or defy them and make an enemy out of your colleagues/boss.
    Sure, once you become the boss, you may and I hope you will modify those rules, but until then, you gotta live by their rules.
    I skipped learning a lot of rote math in my school days, and I find myself struggling to complete examinations on time because of it. Is rote math useless? YES. Is the exam pattern involving following algorithms and being fast, useless? YES. Can I do anything about it? NO.
    And that my friend, is the big difference.
    On a side note, never say no to free and effortlessly acquired knowledge. You never know when you might need it.
    I hope this helped.
    [–]Because_Bot_Fed 0 points1 point2 points  (1 child)
    I totally get what you mean, and agree with a great deal of it.
    I just come from a different path where I say "This is fucking stupid. I'll do it this way, but I'm not going to pretend that we don't both know it's a waste of my time."
    Generally speaking, for the handful of actual direct report managers I've had, no one really cares if you let them know you think something is dumb as long as you're doing as you're told, and occasionally it does actually open up real conversations, and things get changed. A few years ago in my previous role I was an agent of change for the better in my department. I removed a lot of redundancy and unnecessary obfuscation of simple tasks with unnecessary busywork, and automated a great deal of tedium. But my job wasn't math based, so I guess that's why I don't have a great deal of insight into what is or isn't still relevant in a real world job. :)
    [–]Screye 0 points1 point2 points  (0 children)
    Then we are on the boat.
    In my short stint at the industry, most bosses are receptive about redundant rules.
    [–]chenzo711 1 point2 points3 points  (0 children)
    I've found having a more complete understanding of the foundation helps immensely when learning harder concepts and applying them. These tricks help you see some of the relationships and interdependencies in the operations we have memorized. Rote memorization gets harder and harder at each "level" of math. If you have a better understanding of addition and multiplication it helps when learning how to manipulate functions, the rules for calc etc. Calculators may solve these problems, but the application of the math is where it really can't take over (yet). I completely understand why calculator free purists exist.
    [–]shieldvexor 0 points1 point2 points  (0 children)
    Well it's pretty hard and cumbersome to do algebra when you need to continuously grab a calculator at every step because you can't do addition. Algebra is easy for computers but there is a lot of math that they still can't do
    [–]SwanseaJack1 0 points1 point2 points  (0 children)
    Well, it's useful for me as I'm taking the HESI and TEAS later this year, and they don't allow calculators to be used, so I'm sure this will come in handy at some point.
    [–]AtomicSteve21 -3 points-2 points-1 points  (1 child)
    More theoretical - Is it a non-zero number? -> Yes
    It's divisible! But the outcome might not be whole numbers.
    4 is of course divisible by 7, you end up with 0.57
    [–]Aquaified 1 point2 points3 points  (0 children)
    To be divisible by a number it must have no remainder, by definition. I understand your thoughts, I made the mistake back in 6th grade, but that is definitely untrue.
    [–]ELaskanator 3 points4 points5 points  (0 children)
    A general way to determine whether two numbers are divisible is by using the Euclidean algorithm (which is fairly efficient (O((log a + log b)2 )) at determining the greatest common divisor) and checking if the result equals the smaller number.
    This has been reformulated to only require subtraction and division by 2 (and iteration and powers of 2 (likely to be small powers)) as follows (the Binary GCD Algorithm):
    Input values a and b to check.
    0) Define auxiliary variable d = 0
    1) While a and b are both even (easy to tell), divide both by 2 and increment d by 1.
    2) While a is not equal to b
    2.1) If a is even, then half it (a = a / 2)
    2.2) Otherwise if b is even, then half it (b = b / 2)
    2.3) Otherwise, take their difference divided by two and set that as the value for the larger of a and b (so if a > b, then set a = (a - b) / 2). Their difference (and sum!) is guaranteed to be even because the preceding clauses imply that a and b are both odd.
    3) Return a * 2d (or b * 2d since a = b at this point), the greatest common divisor (remember that the value of a has been modified by the algorithm).
    4) Compare this result to the smaller of the input values of a and b (your numbers to check). If they are equal, your answer is "yes". Otherwise the greatest common divisor which you just found will be smaller than both a and b.
    If the gcd is 1, that means the two numbers are coprime (and are not even close* to being divisible).
    *share no prime factors, but changing a or b by 1 might change everything
    [–]thevulturesbecame 1 point2 points3 points  (0 children)
    This is more obscure and helps more with multiplication than division, but also with six: six times any even # will always have a product with the same number in the ones place as there was in the number you multiplied 6 by. Eg 6 • 12 = 72 , 6 • 38 = 138
    [–]dolemite_II 1 point2 points3 points  (0 children)
    55318008
    [–]stormy2587 1 point2 points3 points  (0 children)
    Why should I know this? I believe it's better to be able to figure things out then have a bunch of rules memorized when it comes to stuff like math. Honestly, from TAing physics throughout undergrad those were the people who frustrated me the most. They couldn't take a piece of information and see how it could be manipulated to get another piece several steps removed. They just wanted to be able to plug some numbers into a rule they memorized and quickly spit out the number they needed. I think teaching math this way makes people think that math is some archaic set of rules that's not applicable to their lives. When it's actually a pretty powerful architecture for solving quantitative problems.
    Basically these are cool tricks but I think there are easier ways to factor things. Like using the computers all around us. Also few numbers you encounter factoring in life will ever be: a) important enough to not round to the nearest power of 10, b) have 7 as the largest prime number they are divisible by.
    [–]zecchinoroni 1 point2 points3 points  (0 children)
    So for the 9 one, can you just divide by 3 three times? And if you end up with a whole number, it's divisible by 9?
    [–]Damjo 0 points1 point2 points  (0 children)
    Eerily I was just thinking about this half an hour ago before I jumped on reddit and saw this by chance
    [–]jgregor92 0 points1 point2 points  (0 children)
    My favorite one is the alternating sum rule for 11. If you add the first digit of a number, subtract the second, add the third, etc. and the result is divisible by 11 or is zero, then the number is divisible by 11.
    Example: 11935: 1-1+9-3+5=11, so it is.
    [–]sd522527 0 points1 point2 points  (0 children)
    General rule for numbers coprime to 10: find the first multiple with a 1 in the rightmost digit. Make a rule so that (some multiple of number without unit digit) + (some multiple of unit digit) equals zero (mod your number). That gives a test that always works for divisibility. For example:
    17×3 = 51. So the check if any number is divisible by 17, multiply the units digit by 5 and subtract from the rest. So with 578, 57 - 8×5 = 17, so it is divisible.
    13×7 = 91. Since 9 + 1×4 = 13, we can use the rule of multiplying units digit by 4, then adding to the rest. So with 182, 18 + 4×2 = 26, which is divisible by 13, so the original one was too.
    [–]grizzburger 0 points1 point2 points  (0 children)
    No I should definitely not know this. I've had just about enough of GMAT quant problems, tyvm.
    [–]shlogan 0 points1 point2 points  (0 children)
    Anyone know if the pattern of the 4 and 8 rule works with higher multiples? Like is there a 16 rule were "if the last 4 digits are divisible by 16 then the whole number is. If you don't know half the last 4 digits 4 times and if it's a whole number it's divisible?"
    [–]Theyrealone 0 points1 point2 points  (0 children)
    21 last digit 22 2 last digits 23 3 last digits Didn't notice this until now
    [–]timdunkan 0 points1 point2 points  (0 children)
    Am I doing something wrong here with the #7 rule or is this the exception?
    • Number: 126
    • 12-(6*2) = 0
    • 126 = (7 * 18)
    I tried 7 * 18 randomly & worked my way backwards
    [–]jwsx18 0 points1 point2 points  (0 children)
    But of course it's far easier to keep subtracting multiples of 7 you know from the rest.
    [–]Endless_Summer -1 points0 points1 point  (5 children)
    Also, there is no equation for finding prime numbers.
    [–]exoticmind 3 points4 points5 points  (2 children)
    You can memorize those... the ones less than 100, that is. Higher ones, just use wolframalpha.
    [–]phunphun 0 points1 point2 points  (1 child)
    For the ones less than 100 you can use the rules that OP gave to find out if a number is prime or not in a couple of seconds + the 11 rule.
    [–]the-axis 0 points1 point2 points  (0 children)
    The only number under 100 you can't check with 2, 3, or 5 is 49 which is easy enough to memorize since it the square of the only other prime under 10, 7.
    [–]XkF21WNJ 2 points3 points4 points  (0 children)
    That really depends on your definition of 'equation'. According to Wilson's theorem you can test if a number n is prime using:
    (n-1)! mod n = -1
    Or you could use a more straightforward method:
    gcd((n-1)!, n) = 1
    Edit: One using only (complex) differentiable functions: sin(π Γ(n)/n) ≠ 0, works for all n>1 except 4.
    [–]TheRammer 1 point2 points3 points  (0 children)
    There are prime producing polynomials. Try n2 -n+41 for n=0 to 40. Thank Euler.
    [+]sxales comment score below threshold-15 points-14 points-13 points  (2 children)
    so . . . YSK grade school math?
    [–]CEFHCL 18 points19 points20 points  (0 children)
    Yes, yes you should.
    [–]UlyssesSKrunk 0 points1 point2 points  (0 children)
    And you should probably learn some grade school English if you're going to be such a smartass.
    Use of this site constitutes acceptance of our User Agreement and Privacy Policy (updated). © 2016 reddit inc. All rights reserved.
    REDDIT and the ALIEN Logo are registered trademarks of reddit inc.
    π Rendered by PID 10657 on app-341 at 2016-01-13 05:59:49.753616+00:00 running e64ffcc country code: US.
    0%
    10%
    20%
    30%
    40%
    50%
    60%
    70%
    80%
    90%
    100%