David Sycamore

45 Reputation

4 Badges

2 years, 0 days

MaplePrimes Activity

These are replies submitted by David Sycamore

@Carl Love 

No calculation error, transcription mistake.  Thanks to everyone who responded; great response and so quick.

@vv Sorry I dont understand your reply. What must I do to get the same results for P(n)  as you did, using your latest code ?


@vv Thanks very much for that. 
I copy pasted it, put P(50) and hit return.The output I got  was every prime <=50 (ie 2,3,...,47), whereas you  got the correct answer (2,3,5 7,11,13,19). Could this be because my version is 2017? Please advise any changes to make it work.







I got it running, have now ~50 terms which is great. I would now like to examine for each number n in the sequence the set P(n) of partition primes of n. Is it possible to adapt the code for this purpose?

Thanks in advance



Just checking how to do this: Copy paste code from the outline box above into a new worksheet, do changes for 2017, and then add :

for n from 2 to N do 

if........ fi


Then run

Is that right?


@David Sycamore 

Will it work in 2017?


Thanks very much for this; great job! I will try to run it later today (with Maple 2017).


@Carl Love Thanks for the clarification. I wrote {phi} because there was no way to write the usual Greek letter. What I meant was of course the empty set {}, not the set containing the empty set as sole element. 

@David Sycamore 

I wonder if it could be possible to argue (using the Goldbach conjecture) that for an even number 2n we will always be able to find a p in P(2n) such that 2n-p is a prime q>p such that p is not a member of P(q). Then p+q=2n and this is the only partition of 2n having p as least part.  Ergo in the set of partitions of 2n we will always find a (p,1), which if correct means that the numbers I am looking for are all odd composites (like 63,161...), no need to look for primes or even numbers. 

@Kitonum Yes I mean that {phi} is empty set and I thought that notation was universal, just that I have no way to write it as it appears in text books.



1. No restriction on the number of summands or the starting (least) prime which I call a "partition prime" of n (my own terminology, it might be called by another name elsewhere). 

2. Yes this is about partition of any whole number n into primes, so all the  summands are primes and they don't have to be distinct.

3. Let P(n) be the set of partition primes of n, so for n=12, P(12)={2,3,5}. Any prime partition of 12 must have one of these numbers as least part. Q(n) is a subset of P(n) and lists the "singular partition primes of n", meaning those which appear (as least part) in one and only one partition of n into primes. So Q(12)={3,5} because 3+3+3+3 = 5+7 = 12 are the only possible choices having least part 3 and 5 respectively.

I have a recursive method for computing the overall number of partitions of n into primes by adding up the number of partitions with least part p, for every p in P(n). This works but is laborious and I don't know how to tackle a code for it, which is why I sought assistance on here. 

4. The strange thing about 63 is that it has no singular partition prime. Compare the following: 46 is chosen at random:

P(46)= {2,3,5,7,11,17,23}, and the associated partition numbers are: (2,456), (3, 77), (5, 17), (7, 4), (11,1),  (17,1), (23,1), where (p,m) means there are m partitions (of 46) having least part p. Thus Q(46)={11,17,23}. However P(63)={2,3,5,7,11,13,17}, for which the corresponding partition numbers (for all p in P(63)) are: (2,2198), (3,323), (5,60), (7,15), (11,5), (13,2), (17,2). Since there is no (p,1) in this collection, Q(63)={phi}, the empty set. I thought that this was a one-off anomaly number because no ´n<63 has this property, but then found that 161 has the same property. P(161)={2,3...47} and the partition numbers are (2,1305679), (3,124055), (5,15646), (7,3006), (11,687), (13,236), (17,85), (19,38), (23,16) (29,9), (31,4), (37,2), (41,4), (43,2), and (47,2). There is no (p,1) in this set so Q(161)={phi}. My calculations have now reached 167 and these are the only two numbers having this property, which is why I am curious to know if there are any more. 

I hope this clarifies my question and that you can help with a code. 



ps: Carl please say what was wrong with my use of {phi}?

@tomleslie Thanks Tom. I guess because I have a different Maple version from yours (2017), my system copied your code reluctantly (warning it might not work), which it did'nt ("unable to execute seq"). Did we not have this problem last time?

 I copied it out by hand into a new worksheet and tried again. This time ("local f is declared more than once in procedure doWork"). I had ben wondering about this (f twice) thing before, and  assumed its something ok for your version but maybe not mine (?). The second line of code says "interface(version)" am I supposed to put the version there, or does it mean something else? Sorry so many questions, none of this is "trivial" for me. 

@David Sycamore Sorry to come back again on this code. For oeis I would aappreciate to have a version of the code which just outputs the numbers a(n), for n up to arbitrary N (no factor sets, just single numbers including the zeroes where there are no solutions up to some M). I have tried to extract this from your code by just taking out the doWork proc, but cannot get it to work. Hope you wont mind to show me how to do this. (code will of course be attributed in oeis entry).


@Carl Love Yes of course; its obvious that containing itself as a proper subsequence means it contains  infinitely many copies of itself. However, I was thinking in terms of  independent copies (indeed it is powers of 4, not 2, but maybe should be q>0?). So there are infinitely many independent copies, each of which contains infinitely many copies ......... Right?

@Carl Love Great work, thanks.

Seems that the sequence may contain infinitely many copies of itself. Your find a(4*q+2) for a 4-spaced subsequence can be generalised to a(2^n*q+2^n-2) for a 2^n-spaced subsequence (n>=2). Would you agree?

@Carl Love 0 1 2 3  4     (indices)

                    0,0,0,1, 0     (terms)

Here the initial (given) terms are a(0)=0, a(1)=0 (see above, indices written over terms; terms separated by commas, indices not). We have a(0) and a(1) and want to find the next term, a(2), so we ask here: Have we seen this (most recent) number (which is a(1)=0 ) prior to this occurrence of it? And if so what was its position (index)? Answer is yes and we saw it before as the 0-th term, (its index was 0), so now we have a(2)=0. (we can now imagine "marking" that index, to show that it has been used, so we dont use it again). Now we want a(3): Have we seen this number (which is a(2)=0) before? Yes, it is a 0 and the nearest, most recent, "unmarked" place it was seen was at a(1)=0, whose index was 1, so a(3)=1. Now for a(4): Have we seen this number (which is a(3)=1) before? Answer is no, so we follow the rule: a(n+1)=a(a(n)-1), getting a(4)=a(a(3)-1)=a(1-1)=a(0)=0; therefore a(4)=0. And so on....

( "Last" means the most recent unmarked occurrence)



1 2 3 4 Page 1 of 4