Question: How to compute integer sequences involving concatenation?

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:

1,3,7,2,4,5,9,6,13,8,19,11....

(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:

1,2,3,5,10,4,8,6,11,20,13,7,9,12,15,18,14,25,30.....

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

Thanks in advance for any assistance with this 

Regards

David.

 

 

Please Wait...