login
a(n) = the smallest value of the form n*k - 1, k = positive integer, that is coprime to all the previous terms of this sequence. a(1)=1.
3

%I #14 Oct 23 2017 05:28:03

%S 1,1,2,3,19,5,13,7,17,29,43,11,103,41,59,31,67,53,37,79,83,109,137,23,

%T 149,181,107,139,173,89,61,127,131,101,349,71,73,113,233,199,163,167,

%U 257,263,179,229,281,47,97,449,509,311,211,269,439,223,227,347

%N a(n) = the smallest value of the form n*k - 1, k = positive integer, that is coprime to all the previous terms of this sequence. a(1)=1.

%C Are there any composites in this sequence? If not, is this sequence, with the exception of terms a(1) and a(2), a permutation of the primes?

%H Michael De Vlieger, <a href="/A139319/b139319.txt">Table of n, a(n) for n = 1..1000</a> (first 100 terms from Andrew V. Sutherland).

%H Andrew V. Sutherland, <a href="/A139317/a139317.txt">Comments on A139317 and A139319</a>

%e For a(10) we check: 10*1 - 1= 9, which is not coprime to a(4)=3. 10*2 - 1= 19, which is not coprime to a(5)=19. But 10*3 - 1 = 29, which is coprime to terms a(1) through a(9). So a(10) = 29.

%t Fold[Append[#1, SelectFirst[#2 Range@ 120 - 1, Function[k, CoprimeQ @@ Append[#1, k]]]] &, {1}, Range[2, 58]] (* _Michael De Vlieger_, Oct 22 2017 *)

%Y Cf. A139317, A139320.

%K nonn

%O 1,3

%A _Leroy Quet_, Apr 13 2008