David Sycamore

45 Reputation

4 Badges

2 years, 37 days

MaplePrimes Activity

These are questions asked by David Sycamore

I am trying to count of the number of primes p such that when p is concatenated with 1 (ie p1, or 10*p+1),  if p1 is composite then we record the result 1, else  2. This gives the minimum k for which the concatenation pk is composite, and k is always either 1 or 2. It would be interesting to compare the number of primes with 1 and those with 2 up to a given max. I have already written a code which calculates the 1 or 2 for each prime but have not managed to adapt it keep count.

I would like to have a code to keep a count  of the 1s and 2s, thus being able to say that up to 10^k we see {a, b} where a is the number of primes with "1" and b is the number with "2".

Ideally I would like to be able to output plots of these data for any k =1,2,3,... up to a pre declared maximum k value, so as to make comparative graphs. I do not know how to organise the counting process, or if it is possible to get Maple to do the plots as well. Can anyone please assist me with this? I have Maple 2017.

Best regards,



Each term of the following sequence is derived using the sum of all preceding terms following a simple algorithm. I have tried to code it but without success (keep getting error message "too many levels of recursion"). 

Definition is as follows:

a(0)=0, a(1)=1;  for n>=1,

a(n+2) = n + Sum{k=1..n+1} a(k). 

it starts: 0,1,2,5,11,23,47,95,191,767,1536,3071,6143...

(Looks like every prime term is of the form 3*2^m-1). 

Cann anyone suggest a solution?



We can say that prime p is a partition prime of n if there is at least one prime partition of n having p as least part. Example 8=3+5 so 3 is a partition prime, but 5 is not.

Furthermore, say that p is a singular partition prime if there is one and only one partition of n with p as least part. I am trying to find numbers n for which the set Q(n) of singular partition primes is {phi}. That is to say, if we take any prime partition of n, then there are at least two partitions associated with its least member. I find so far only two examples: 63 and 161. Clearly no such n can be prime because then n is a singular partition prime of itself (Incidentally, primes having only themselves as singular partition primes are: 2,3,7,13,23,31,41,79,101,107,149..).

I am asking for a code to compute more terms for the case Q(n)={phi}. 

Thanks in advance


How is it possible in Maple to keep hold of pre determined results for comparison with subsequent results so that a recursive decision can be made to either modify the list of “kept” data or to continue to the next calculation, etc... ?

Example: a simple “subtract or double” sequence. If subtracting (say 1) from the current number would result in a term we already have,  then double it instead, and start over again with subtraction.

Formally: a(0)=0, a(1)=1, and for n>=1,

a(n+1) = a(n)-1 if that number has not been found already, else a(n+1)=2*a(n).


The arithmetic operations are facile but how to organise the keeping and comparison process??



Take any odd number k, with distinct odd prime divisors p_1,...p_k and ask the following question: What is the smallest even number which when added to each prime divisor p_i of k, gives another prime? Example: k= 119=7*17, so the smallest even number is 6 because 7+6=11 and 17+6=23. NB: some numbers (eg 105,195,231...) seem to have no solution. I would appreciate assistance with a code to calculate for every odd k, the even number in question, or to allocate 0 for numbers where no solution has been found up to some suitably convincing high number like N= 10^5 or 10^6, (a parameter I could change if desired). The idea would be to conjecture that the apparently no solution numbers (up to N) don’t actually have a solution. Any assistance much appreciated in advance. I have found the solutions up to k=781 by hand, but my hand is getting tired now.



ps: I would like to have the option (if possible) to output the numbers with solution =  0, and the numbers which are the smallest to have solution 2*n, as separate sequences, for n up to some arbitrary value (ie 3,7,23,69,93...). (n>=1). Hope this is not asking too much. 

1 2 3 Page 1 of 3