# Question:How to produce a graph of a numbers sequence

## Question:How to produce a graph of a numbers sequence

Maple 2017

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.

﻿