Author Topic: Math! (and that is not a factorial)  (Read 17609 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #15 on: January 17, 2011, 05:20:20 pm »
Okee, here is some food for thought.
(7x-2) mod 9=0 when x=9K-1
K is an integer
This means that all number that can be expressed as 7(9k-1)-2 can always be divided evenly by 9. This isn't really complex, but it is fun if you like prime numbers

So, when:
x=9k-1     (7x-2) mod 9=0     (7x+7) mod 9=0
x=9k-2     (7x-4) mod 9=0     (7x+5) mod 9=0
x=9k-3     (7x-6) mod 9=0     (7x+3) mod 9=0
x=9k-4     (7x-8) mod 9=0     (7x+1) mod 9=0
x=9k-5     (7x-1) mod 9=0     (7x+8) mod 9=0
x=9k-6     (7x-3) mod 9=0     (7x+6) mod 9=0
x=9k-7     (7x-5) mod 9=0     (7x+4) mod 9=0
x=9k-8     (7x-7) mod 9=0     (7x+2) mod 9=0

When I did this, I learned some things about how numbers work. If you wanna have fun, try using values other than 7 and 9. Something this simple can reveal quite a bit about numbers.

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #16 on: January 30, 2011, 06:36:17 pm »
Okee, here is some food for thought.
(7x-2) mod 9=0 when x=9K-1
K is an integer
This means that all number that can be expressed as 7(9k-1)-2 can always be divided evenly by 9. This isn't really complex, but it is fun if you like prime numbers

So, when:
x=9k-1     (7x-2) mod 9=0     (7x+7) mod 9=0
x=9k-2     (7x-4) mod 9=0     (7x+5) mod 9=0
x=9k-3     (7x-6) mod 9=0     (7x+3) mod 9=0
x=9k-4     (7x-8) mod 9=0     (7x+1) mod 9=0
x=9k-5     (7x-1) mod 9=0     (7x+8) mod 9=0
x=9k-6     (7x-3) mod 9=0     (7x+6) mod 9=0
x=9k-7     (7x-5) mod 9=0     (7x+4) mod 9=0
x=9k-8     (7x-7) mod 9=0     (7x+2) mod 9=0

When I did this, I learned some things about how numbers work. If you wanna have fun, try using values other than 7 and 9. Something this simple can reveal quite a bit about numbers.
Modular arithmetic, it was thought to me and I came up with two independent results:
- you can use modular arithmetic to find divisible criteria like you did, here is a simple example:
let n be a integer number in decimal form
let d(i) be the sequence of its digits in decimal form, i. e., n=sum from i=0 to floor(log(n))+1 of d(i)*10^i or n can be expressed as d(0)+d(1)*10+d(2)*10^2+...+d(n)*10^n
then you have
3 divides n if
3 divides sum d(i)*10^i, that is equivalent to
sum d(i)*10^i = 0 mod 3 <=>
sum d(i)*1^i = 0 mod 3 <=>
sum d(i) = 0 mod 3
so,
3 divides n if the sum of digits of n is divisible by 3

Exercises: do the same for 2, 10, 7 or any number you like.

- I noted what happened to (x+1)^n mod n when n is prime
tips: Pascal triangle, divisibility

Note I don't know how to write mathematics in english conventions, I did the best to translate... Also writing in plain text does not help.
Sorry if you don't understand but I wrote this quickly.
« Last Edit: January 30, 2011, 06:38:11 pm by Galandros »
Hobbing in calculator projects.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #17 on: January 30, 2011, 06:44:00 pm »
That is okay, I do not know how to properly "write math" yet. But yeah, my goal was to use that to test for primes. I'll look into this when my brain is functioning again, but I think I understand :D

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #18 on: January 30, 2011, 06:52:41 pm »
That is okay, I do not know how to properly "write math" yet. But yeah, my goal was to use that to test for primes. I'll look into this when my brain is functioning again, but I think I understand :D
Incredible how some people come up results already known, independently on math after learning the start of things.
And you are on a possible right track, although it gets complicated and you need results like Little Fermat Theorem and Euler's Theorem, many prime testing methods use congruences ideas. :)

I am curious. Are you thinking of following Mathematics to your superior course and career, or keep just as a hobby and possibly work on something related? Remember you are not obligated to answer or reply fast.
« Last Edit: January 30, 2011, 06:53:29 pm by Galandros »
Hobbing in calculator projects.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #19 on: January 30, 2011, 07:51:32 pm »
I am a math major in college and I do plan to go as far as to get a doctorate. I am not 100% sure, but I am fairly certain I will choose a math oriented career such as being a professor.

*By the way, Galandros, I'm Thunderbolt from UTI :D

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #20 on: January 31, 2011, 05:33:51 am »
I am a math major in college and I do plan to go as far as to get a doctorate. I am not 100% sure, but I am fairly certain I will choose a math oriented career such as being a professor.

*By the way, Galandros, I'm Thunderbolt from UTI :D
Good luck then. :)

I know because the projects you show off here match those of ThunderBolt in UTI. :P
Hobbing in calculator projects.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #21 on: January 31, 2011, 08:51:06 am »
I am a math major in college and I do plan to go as far as to get a doctorate. I am not 100% sure, but I am fairly certain I will choose a math oriented career such as being a professor.

*By the way, Galandros, I'm Thunderbolt from UTI :D

Professor like University Professor? (In my country you don't choose if you want to be a professor, you're invited)
Professor like Teacher? That sounds nice.

Also, I think that a Professor (in all ways) is better than becoming a teacher.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #22 on: January 31, 2011, 10:45:05 am »
I would love to be a teacher for other things, but I would prefer to be a professor for math.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #23 on: February 24, 2011, 04:42:23 pm »
Does anybody know where I can find a list of all numbers that are part of three pythagorean triples? My poor calculator found 24 and 840 but it didn't find any others (even at around 10000). I will probably end up trying to create an equation for that, but I want to make sure it isn't just a simple rounding error that is causing me to miss other such numbers.

Offline phenomist

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 132
  • Rating: +46/-3
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #24 on: February 24, 2011, 06:57:18 pm »
(m^2-n^2, 2mn, m^2+n^2) will generate all the pythagorean triples. For instance, m=2 n=1 gives (3,4,5).

Also, the set of all numbers that are part of a pythagorean triple isn't terribly interesting; all numbers larger than 2 are part of a pythagorean triple :P (3,4,5); (5,12,13); (7,24,25); etc. for odd numbers, even numbers just double these triples.
Level Designer for Graviter

[Disclaimer: I can't program for my life.]

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #25 on: February 24, 2011, 06:59:10 pm »
I beleive Zeda wants to know how many numbers are in 3 different Pythagorean triplets
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline phenomist

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 132
  • Rating: +46/-3
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #26 on: February 24, 2011, 07:01:25 pm »
Oh... misinterpreted, sorry.

Well, I suppose you could do individual tests on m^2-n^2=N, 2mn=N, m^2+n^2=N...

In particular, the first two are factorings of N.
Level Designer for Graviter

[Disclaimer: I can't program for my life.]

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #27 on: February 24, 2011, 07:04:06 pm »
i would just right a C program with an overflow at like 5 million run it and see if there are any more
See is fast so it shouldn't take too long if  you use a few optimizations
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline phenomist

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 132
  • Rating: +46/-3
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #28 on: February 24, 2011, 07:31:07 pm »
I'm still wondering though... even given the new conditions, we should still expect to see a LOT more than just 2 numbers in the first 10,000.

For example, 60 should work with (36, 48, 60); (45, 60, 75); (60, 80, 100).
Level Designer for Graviter

[Disclaimer: I can't program for my life.]

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: Math! (and that is not a factorial)
« Reply #29 on: February 24, 2011, 08:20:53 pm »
It might also depend on whether the number must be in 3 triples, or exactly 3 triples, since then 60 wouldn't work (60,63,87 and 60,448,452, for instance would make it at least 5).
« Last Edit: February 24, 2011, 08:21:24 pm by program4 »