barnabas_truman: (math)
[personal profile] barnabas_truman
A few years ago I wrote a simple TI-BASIC program to factor whole numbers. Input a whole number, and it outputs all possible pairs of factors of that number. It was slow but it worked.

Fast-forward to half an hour ago. At some point in the intervening time I had lost and/or deleted the program, so I decided to write it again, because I had been reading an interesting article about prime numbers and factorization. While programming, I decided to tweak it a bit to speed up the process, and in doing so I realized that with just a minor adjustment, I could make it instead output a complete prime factorization of the original input.

In summary--I now have a lovely li'l graphing calculator program I wrote myself that will prime-factor any whole number, and I want to show off. Gimme some numbers to factor!

Date: 2006-10-30 05:15 am (UTC)
From: [identity profile] glaukopis.livejournal.com
Eleventy billion.

Date: 2006-10-30 05:38 am (UTC)
From: [identity profile] barnabas-truman.livejournal.com
11 and a bunch of 2s and 5s.
(deleted comment)

So you think you're pretty clever, don't you?

Date: 2006-10-30 05:42 am (UTC)
From: [identity profile] barnabas-truman.livejournal.com
32582657 is prime. Took a minute or two to get there though.
(deleted comment)
From: [identity profile] barnabas-truman.livejournal.com
It wouldn't. I tried posting a million digits of pi last March 14 and it didn't work.
From: [identity profile] barnabas-truman.livejournal.com
The joke's on you! My buddy Euclid says there IS no longest prime!

Date: 2006-10-30 06:42 am (UTC)
From: [identity profile] terpsichoros.livejournal.com
123456789

9999998

31415926535

Date: 2006-10-30 07:28 am (UTC)
From: [identity profile] barnabas-truman.livejournal.com
123456789 = 3x3x3607x3803

9999998 = 2x4999999

31415926535 = 5x7x31x28954771

Congratulations

Date: 2006-10-30 06:45 am (UTC)
From: [identity profile] whalejudge.livejournal.com
29049832452.8233298029751i

Re: Congratulations

Date: 2006-10-30 08:33 am (UTC)
From: [identity profile] lysandra.livejournal.com
SEG FAULT

Re: Congratulations

Date: 2006-10-30 08:36 am (UTC)
From: [identity profile] barnabas-truman.livejournal.com
+++DIVIDE BY CUCUMBER ERROR IN LINE 3718750170+++
+++PLEASE REBOOT UNIVERSE AND TRY AGAIN+++

Re: Congratulations

Date: 2006-10-30 03:43 pm (UTC)
From: [identity profile] ellipticcurve.livejournal.com
+++DIVIDE BY CUCUMBER ERROR IN LINE 3718750170+++

I love you.

Re: Congratulations

Date: 2006-10-30 04:03 pm (UTC)
From: [identity profile] whalejudge.livejournal.com
Your challenge was, " Gimme some numbers to factor!". I did. Obviously you need to go back into your program and fix it so you can factor the number I gave you.

Re: Congratulations

Date: 2006-10-31 02:05 am (UTC)
From: [identity profile] serendipity17.livejournal.com
He did specify that it will prime-factor "any whole number."

Re: Congratulations

Date: 2006-10-31 02:13 am (UTC)
From: [identity profile] whalejudge.livejournal.com
True. However, he didn't bother to specify that he only wanted whole numbers. He just asked for numbers.

Re: Congratulations

Date: 2006-10-31 02:37 am (UTC)
From: [identity profile] serendipity17.livejournal.com
calculator program... that will prime-factor any whole number...[requests] numbers to factor

I hope you're being difficult on purpose. It's still not a useful suggested number. Maybe if we take i as a separate factor, and swap commas in for your decimal point? However it goes, you've still got way too many significant figures in your multiple of i for the calculator to deal with.

Re: Congratulations

Date: 2006-10-31 03:46 am (UTC)
From: [identity profile] whalejudge.livejournal.com
I'm a lawyer. Paying attention to and capitalizing on errors in written works is what we're trained to do. Yes, the implication is that he wanted whole numbers. That is not, however, what he actually requested. So I gave a number of great length that wasn't whole. It is a way of amusing myself.

Re: Congratulations

Date: 2006-10-31 04:29 am (UTC)
From: [identity profile] barnabas-truman.livejournal.com
Context must be taken into account. My exact wording was "Gimme some numbers to factor." The very fact that I specified that the numbers were to be factored implies, nay, necessitates, that the numbers in question be whole numbers, as these are the only numbers that can be factored.

Re: Congratulations

Date: 2006-10-31 07:33 am (UTC)
From: [identity profile] whalejudge.livejournal.com
So must audience. While I do remember the symbol for an imaginary number is "i", my last mathy class was Statistics about 12 years ago. My last actual math course was calculus seventeen years ago. That whole numbers and whole numbers alone can be factored is not, I must admit, one of the bits of math trivia that happened to lodge in my brain.

Date: 2006-10-30 07:19 am (UTC)
From: [identity profile] nick-101.livejournal.com
78533536379

Yeah, I'm going random.

Date: 2006-10-30 08:36 am (UTC)
From: [identity profile] barnabas-truman.livejournal.com
78533536379 = 17x 4619619787

And yes, 4619619787 is prime, as far as my programming skillz can tell.

Date: 2006-10-30 08:33 am (UTC)
From: [identity profile] lysandra.livejournal.com
phone number!

Profile

barnabas_truman: (Default)
barnabas_truman

February 2024

S M T W T F S
    123
45678910
1112 1314151617
18192021222324
2526272829  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 12th, 2025 08:48 pm
Powered by Dreamwidth Studios