You are not logged in.
Let's say we want the 8th unrestricted partition or p(8).
We generate some generalized pentagonal numbers first. We use:
with n = -4, -3, -2, -1, 0, 1, 2, 3, 4 why we go from -4 to 4 will be clearer when you do some these yourself. Anyway, this generates the sequence
you only keep numbers whose absolute value is < 8 and do not equal 0. So the sequence becomes:
Now the absolute value of each of those numbers is subtracted from 8 to get:
p(8) = p(8-1) ± p(8-2) ± p(8-5) ± p(8-7)
that becomes
p(8) = p(7) ± p(6) ± p(3) ± p(1)
To get the correct signs instead of ± , look at the sequence. If the number that is subtracted from 8 is positive then the ± becomes + if it is negative then it becomes negative.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Wikipedia provides this program:
pentagonal = lambda n : n*(3*n-1)/2
def generalised_pentagonal(n): # 0, 1, -1, 2, -2
if n < 0: return 0
if n%2 == 0: return pentagonal(n/2+1)
else: return pentagonal(-(n/2+1))
pt = [1]
for n in range (1, 1000+1):
r = 0
f = -1
i = 0
while 1:
k = generalised_pentagonal(i)
if k > n:
break
if i%2==0: f = -f
r += f*pt[n - k]
i += 1
pt.append(r)
print pt
I just replaced the condition of the loop with what I require
I got the answer within a few seconds
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Hi;
Did you understand what I did in post #26?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Yes!
1. To calculate a partition, we have to calculate(some of) the previous partitions.
2. We need to know that p(1) = 1
I can understand how we use it, but not the principle behind it
Last edited by Agnishom (2012-09-15 17:17:43)
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Hi Agnishom;
Have you seen my signature? That is from a top mathematician. If he has trouble understanding some things what can be expected of us? Fortunately, if you understand the mechanics of a math technique or algorithm you can then use it. I gave you the how it works stuff, the why it works is much tougher and I do not fully understand it.
Incidentally, I only showed this rather inefficient technique as a means to solve that specific problem.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Grand Idea!
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
By the Way, Once upon a time you had a signature about wastage of time and money. Would you please explain that?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Hi Agnishom;
I do not remember that one, can you give me a hint?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Something like this:
How often do I see money and time being wasted..............
Then You told something about calculations....
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Hi Agnishom;
That is very good that you remember that much. I wished I could remember the
entire quote and who said it. If I do I will explain.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
At that time I never understood what they were as I did not have the concept of Signatures. They seemed very confusing to me
Big discoveries are protected by public incredulity.
What is the meaning of public incredulity?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
It means, that big discoveries are looked at with disbelief by the general public.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hi all;
That is close.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
How close?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Pretty close...
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Where do the La***ta files come in?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
There is a difference between how Marshall McLuhan and I interpret that quote.
I did not know him personally or attend the parties he did or hang in his social set.
Therefore I do not know what secrets he was exposed to.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline