Ok, that one was hard: find the largest prime factor of a 12 digit number. Problems I ran into -- inefficient algorithms, and trouble entering in the number, since 12 digits is bigger than the largest int primitive in Java, and I needed to enter it as a long. However, I couldn't just enter it directly, because the Java compiler tried to read the number as an int, so I had to bring it in as a string, then use the Long.parseLong(string x) method in the Long class to get it into the variable before I could even get started on the algorithm.
This is as much to get me refamiliarized with Java as it is solving the problems. Long way to go . . . .
-
A new feature on rss.chat, *images*. Up to 2MB per. User interface couldn't
be simpler, get the image on your clipboard, start editing your post, put
the c...
Calibration Nobel
-
[image: We would like to once again apologize to Dr. Jones for last year's
mistaken announcement. We should really have double-checked the envelope
for thi...
Every Choice Changes Everything: The Show
-
About 3 weeks ago, Leo Laporte and I recorded the first episode of what
will be a new monthly show on the TWiT network. Naming things is hard, and
we alm...
Welcome, Prashanth!
-
Last March, I shared that we were starting to look for a new CEO for Stack
Overflow. We were looking for that rare combination of someone who… Read
more "W...
Five things we should clear up
-
1. A car should not have to “honk” when you lock it 2. Farts should be
acknowledged, if not celebrated 3. Mr. Obama is not _actually_ reading your
Twitter ...
Episode 51: Vintage Vape
-
Whether you like baseball, chicken dinners, multilevel marketing, or *The
Price is Right*, we offer several varietals of bespoke juices you can enjoy
wit...
Instapaper 4: Deciding to Read
-
[image: Instapaper 4 Icon]
*Introducing Instapaper 4.0 for iPad and iPhone*
The lede here is that my pal, Marco, has just released the stellar new 4.0
v...
Apple Blossoms
-
I'm a potter, a farmer, and a foodie. They all go together so beautifully.
Come see why at our upcoming pottery show...
Hinckley Pottery’s 19th Annual Stud...
Leeks
-
Onwards with my discourse on leeks. Along with onions and garlic, leeks are
in the Alliaceae family. While certainly not very popular in Texas, leeks
are...
4/23/2010
ReplyDeleteFinished the first Project Euler problem.
4/23/2010
ReplyDeleteFinished the second Project Euler problem. However, they're getting much harder.
4/24/2010 Problem #3
ReplyDeleteOk, that one was hard: find the largest prime factor of a 12 digit number. Problems I ran into -- inefficient algorithms, and trouble entering in the number, since 12 digits is bigger than the largest int primitive in Java, and I needed to enter it as a long. However, I couldn't just enter it directly, because the Java compiler tried to read the number as an int, so I had to bring it in as a string, then use the Long.parseLong(string x) method in the Long class to get it into the variable before I could even get started on the algorithm.
This is as much to get me refamiliarized with Java as it is solving the problems. Long way to go . . . .