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 . . . .
-
Regular readers of my blog know that I've been calling out Bluesky and
people associated with it for saying they're an open platform, and part of
the web, ...
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 . . . .