# Search:

Type: Posts; User: aesguitar

Page 1 of 7 1

1. ## Thread: Fibonacci sequence

by aesguitar
Replies
2
Views
192

### Re: Fibonacci sequence

I'll give you a hint, here is the formula.

An = An-1 + An-2

Where A1 = 1 and A2 = 1.
2. ## Thread: Factorial calculation optimization

by aesguitar
Replies
5
Views
305

### Re: Factorial calculation optimization

Problem 160 - Project Euler

Problem 160. I've been working on it for a while. First attempt was to brute force the factorial using JScience's LargeInteger class and huge multi-threading. That took...
3. ## Thread: Factorial calculation optimization

by aesguitar
Replies
5
Views
305

### Re: Factorial calculation optimization

Ok, well, you can use De Polignac's formula to figure out how many factors of a prime factor there are in n!.

Could you also explain this a different way?

This is a project Euler...
4. ## Thread: Factorial calculation optimization

by aesguitar
Replies
5
Views
305

### Factorial calculation optimization

For a problem I'm working on, I need to calculate some very, very large factorials; or at least the first five non-zero digits of said factorial. I've worked out the function:

F(n) =...
5. ## Thread: Inventory application with Read, Delete, Insert and Update Methods

by aesguitar
Replies
6
Views
264

### Re: Inventory application with Read, Delete, Insert and Update Methods

First repost your code in the [code=java][/code ] tags to maintain formatting and highlighting. Also, post the errors your are getting.
6. ## Thread: Number of permurations an memory problems.

by aesguitar
Replies
20
Views
451

### [SOLVED] Re: Number of permurations an memory problems.

The only other way I could think of is to create a 2d array. I don't know how that effects how much memory is available though.
7. ## Thread: Number of permurations an memory problems.

by aesguitar
Replies
20
Views
451

### [SOLVED] Re: Number of permurations an memory problems.

Create an arraylist of files containing the permutations, then simply get the required permutations from the containing file.
8. ## Thread: I need some help with how to use te java.security to generate random numbers

by aesguitar
Replies
1
Views
105

### Re: I need some help with how to use te java.security to generate random numbers

The board is called "What's wrong with my code" meaning you have to post some code here.
9. ## Thread: StackOverflowError in JScience

by aesguitar
Replies
0
Views
120

### StackOverflowError in JScience

I'm using the LargeInteger class in JScience to calculate the first five digits after the trailing zeros of huge factorials. I keep getting a StackOverflowException when the program nears completion....
10. ## Thread: Number of permurations an memory problems.

by aesguitar
Replies
20
Views
451

### [SOLVED] Re: Number of permurations an memory problems.

I saw you were using nested for loops

for(/*conditions blah blah blah*/)
{
for(/*conditions blah blah blah*/)
{
for(/*conditions blah blah blah*/)
{
11. ## Thread: Number of permurations an memory problems.

by aesguitar
Replies
20
Views
451

### [SOLVED] Re: Number of permurations an memory problems.

Ok, what's your purpose is storing the combinations? Are you trying to find the number of combinations or permutations, or are you actually trying to store all the combinations for whatever reason?...
12. ## Thread: strange for-loop what is it doing?

by aesguitar
Replies
6
Views
259

### Re: strange for-loop what is it doing?

Not just an array, but any Collection or array.
13. ## Thread: Number of permurations an memory problems.

by aesguitar
Replies
20
Views
451

### [SOLVED] Re: Number of permurations an memory problems.

OK, a few things. If you want to store every single possible combination, you're going to have to post specs, specifcally, how much RAM you have. I'll take a guess at 3 gigs. Windows 7 takes about...
14. ## Thread: Incompatible types.

by aesguitar
Replies
7
Views
126

### Re: Incompatible types.

Strings are not JTextFields, you need to get what's in the text field to compare with a String.
15. ## Thread: Few things with my Cardano triplet algorithm

by aesguitar
Replies
10
Views
365

### Re: Few things with my Cardano triplet algorithm

Hyper threading means each physical core acts as two logical cores.

lim = 1,000,000
time = 418 seconds
triplets = 163714
...
16. ## Thread: Few things with my Cardano triplet algorithm

by aesguitar
Replies
10
Views
365

### Re: Few things with my Cardano triplet algorithm

Thanks for that one, it reduced the 100,000 time from 25.5 seconds to 16.4 seconds. Next thing I will try is threading. I have 8 usable cores, so how does 16 or 24 Threads sound (i7 3770 @ 3.4 GHz...
17. ## Thread: Few things with my Cardano triplet algorithm

by aesguitar
Replies
10
Views
365

### Re: Few things with my Cardano triplet algorithm

Well, I've got the run-time for a lim of 100,000 down from 35.5 seconds to 24-25 seconds with a few tweaks I found, Like the maximum value of a that contains any triplets at all approaches lim/2.

...
18. ## Thread: Few things with my Cardano triplet algorithm

by aesguitar
Replies
10
Views
365

### Re: Few things with my Cardano triplet algorithm

Unfortunately, your hypothesis isn't correct. I ran the algorithm such that a+b+c<=1,000,000 but a <= 10,000 to save time. Here's the output:

a = 2000 ; tot = 2993 ; Time = 14.277 sec.
a =...
19. ## Thread: Encryption

by aesguitar
Replies
2
Views
151

### Re: Encryption

You're going to need to explain more if you want help.
20. ## Thread: Few things with my Cardano triplet algorithm

by aesguitar
Replies
10
Views
365

### Few things with my Cardano triplet algorithm

I'm trying to work through problem 251 on Project Euler. Problem 251 - Project Euler

I've got a working algorithm with a few shortcuts while maintaining 100% accuracy. However, it isn't fast...
21. ## Thread: Problem getting rid of congruent triangles from a counter.

by aesguitar
Replies
16
Views
185

### Re: Problem getting rid of congruent triangles from a counter.

Run this. I'll give you my Timer.

public class Tester {

/**
* @param args
*/
public static void main(String[] args) {
22. ## Thread: Problem getting rid of congruent triangles from a counter.

by aesguitar
Replies
16
Views
185

### Re: Problem getting rid of congruent triangles from a counter.

That solved it. How fast does this algorithm run for you? I have a new computer with a very fast i7 in it. Does it run in about 10ms for you with out the debug printing? Just want to see how...
23. ## Thread: Problem getting rid of congruent triangles from a counter.

by aesguitar
Replies
16
Views
185

### Re: Problem getting rid of congruent triangles from a counter.

Because right triangles with perimeter 12 were the only ones found. The sides array was supposed to be added twice to perims.get(12) on two separate occasions. Which it was, but something apparently...
24. ## Thread: Problem getting rid of congruent triangles from a counter.

by aesguitar
Replies
16
Views
185

### Re: Problem getting rid of congruent triangles from a counter.

This is the code I'm using to print out perims.

for(int i = 0; i < perims.size(); i++)
{
System.out.print("perims:" + i +": ");
for(int[] j : perims.get(i))
{...
25. ## Thread: Problem getting rid of congruent triangles from a counter.

by aesguitar
Replies
16
Views
185

### Re: Problem getting rid of congruent triangles from a counter.

This is what I get when I print perims after everything is added together, before anything else happens.

Perimeter: 12 ; Sides: {3, 4, 5}
Perimeter: 12 ; Sides: {4, 3, 5}
perims:0: ...
Results 1 to 25 of 153
Page 1 of 7 1