David Sycamore

95 Reputation

4 Badges

4 years, 362 days

MaplePrimes Activity

These are questions asked by David Sycamore

Requesting a procedure to calculate primes p for which there exists a prime q <= p such that pi(p)=q-pi(q), where pi is the prime counting function. If possible options to select output as p, or as (p,q).

p list starts:2,13,17,29,31,43.....

q list starts: 2,11,13,17,19,23...

Thanks in advance,


A083758 is the lexicographically earliest infinite sequence of distinct primes such that the concatenation of the first n terms is prime for all n>=1. It starts: 2,3,11,7,41,31..

The first ~ 1000 terms are already known from other codes (Mathematica, PARI), and it so far primes 13,47,61... have not yet been seen in the data. Progress beyond this point is difficult because of the rapid growth of the concatenations and uncertainties about the primality of such large numbers.


I would like to know if it could be possible to have a Maple code (operable in the 2017 version) which could produce terms significantly the first 1000 terms, and including a mechanism for flagging (at the end of any given run) the smallest prime not yet seen in the sequence?


Best regards


General question: I write integer sequences in Maple (often with your help).

Once I have a working code, able to output any chosen number of terms, is there a standard way to modify the code so as to get a graph (eg linear linear or linear log, etc...)? 

Here is an example : 


A[1]:=1: P:=0; Q:=0; # P counts primes, Q non primes.

for n from 1 to 100 do

if not isprime(A[n]) then



else P:=P+1;




[seq(A[i], I=1..1000)];


The code gets the right data and I would like to make graphs of it. Is it possible to modify the code for this?

Thanks in advance


I would appreciate to know how to compute the following in Maple:

Sequence of distinct primes (starting term is 2) such that each subsequent term is the smallest prime not yet seen whose leading digits and the sum of the digits of the previous term are the same. It starts: 2,23,5,53,83,11,29..

it should be interesting to see which primes with first digit 3 appear (given that 3 is not a term). I would also like to be able to change the first term (eg to 3).

Best regards


I would appreciate seeing how Maple handles concatenation, digital sums and selection of related least terms. Here are two examples of problems currently of interest:

1. Construct the lexicographically earliest sequence of distinct positive integers such that the sum of the digits of the first n terms is coprime to their concatenation; first term is 1:


(I already have many terms for this, computed by a  Mathematica code, but would like to see it done in Maple).

2. Lexicographically earliest sequence of distinct positive integers such that the n-th term divides the concatenation of the first n terms; first term is 1:


(these terms found one by one, using Maple in manual mode, no code).

Thanks in advance for any assistance with this 





1 2 3 4 5 Page 2 of 5