David Sycamore

95 Reputation

4 Badges

4 years, 186 days

MaplePrimes Activity


These are questions asked by David Sycamore

Hi,

I have a code (see below) for the following number sequence and want to produce a graph as well as the numerical data, please advise how to do it.

Sequence definition: Lexicographicaly least sequence of nonnegative integers commencing 1,3,5,7 such that any four  consecutive terms are mutually coprime.

The code I have so far is: 

ina := proc (n) false end :

a := proc (n) option remember; local k;

if n < 5 then k := 2*n-1

else for k from 2 while ina(k) or igcd(k, a(n-1)) <> 1 or igcd(k, a(n-2)) <> 1 or igcd(k, a(n-3)) <> 1

do  od 

fi; ina(k) := true; k

end proc;

seq(a(n), n = 1 .. 100);
1, 3, 5, 7, 2, 9, 11, 13, 4, 15, 17, 19, 8, 21, 23, 25, 16, 27, 

  29, 31, 10, 33, 37, 41, 14, 39, 43, 47, 20, 49, 51, 53, 22, 35, 

  57, 59, 26, 55, 61, 63, 32, 65, 67, 69, 28, 71, 73, 45, 34, 77, 

  79, 75, 38, 83, 89, 81, 40, 91, 97, 87, 44, 85, 101, 93, 46, 

  95, 103, 99, 52, 107, 109, 105, 58, 113, 121, 111, 50, 119, 

  127, 117, 62, 115, 131, 123, 56, 125, 137, 129, 64, 133, 139, 

  135, 68, 143, 149, 141, 70, 151, 157, 153

I have tried listplot but for some reason cant get the correct format

Hope you can help

Best regards

David.

Requesting a code to compute (and graph) the following self referencing sequence:

a(1)=1. If a(n) is a novel term (seen for the first time) then a(n+1)= d(a(n)) where d(k) is the number of divisors of k. 
if a(n) has been seen before then a(n+1) = a(n)+m where m is the least prior term which has not already been used in this way (once m is used it cannot be used again).

Sequence starts:

1,1,2,2,3,2,4,3,5,2,4,6,4,7,2,5,7,11,2...,

note that there are often multiple copies of the least unused term, which might make accounting for them tricky. 

Thanks in advance 

 

 

See A342180 in OEIS. Two codes have been written for this, one in Python (17 terms found), the other in Mathematica (33 terms). Could a Maple code go beyond a(33), assuming higher terms exist? 

Requesting a code to compute the following self referencing integer sequence :

a(1)=1, a(2)=0. Thereafter, if a(n) is a novel term then a(n+1)=Min{|a(n)-a(k)|; 1<=k<n}. Otherwise, if a(n) seen before (most recently at a(m)), then a(n+1)=n-m.

First few terms are:

1,0,1,2,1,2,2,1,3,1,2,4,1,3,5,1,3,3,1,3,2,10,5......

Desirable to have option for graphing results up to some value of n.

Thanks in advance for any assistance

David.

 


Requesting a code to compute for n>=1 the number of distinct proper divisors of n which properly divide a proper divisor of n.

0,0,0,1,0,1,0,2,1,1,0,3,0,1,1,3,0,2,0,3,1,1,0,5...

example: n=24= 2^3*3

There are 5 proper divisors of 24 having the above property: 1,2,3,4,6, so a(24)=5.

1 2 3 4 5 Page 1 of 5