A143345 Lexicographically earliest sequence such that a(n) is coprime to the preceding 4 terms (or n-1 terms if n<5) and does not occur earlier.
1, 2, 3, 5, 7, 11, 4, 9, 13, 17, 19, 8, 15, 23, 29, 31, 14, 25, 27, 37, 41, 16, 35, 33, 43, 47, 26, 49, 45, 53, 59, 22, 61, 21, 65, 67, 32, 71, 51, 55, 73, 28, 79, 39, 83, 85, 38, 77, 69, 89, 97, 10, 91, 57, 101, 103, 20, 107, 63, 109, 113, 34, 95, 81, 121, 127, 46, 119, 75, 131, 137, 44, 133, 87, 115, 139, 52, 149, 93, 125, 151, 56, 143, 111, 145, 157, 62, 161, 99, 163, 167, 40, 169, 123, 173, 179, 50, 181
Offset: 1
Keywords
Links
- Zak Seidov, Table of n, a(n) for n = 1..5000
Programs
-
PARI
print1("1,2,3"); a=[1,2,3,L=5]; unused=[4]; v=vector(#a,i,1); for(n=4,99, print1(","a[#a]); for(i=1,#unused,apply(x->gcd(x,unused[i]),a)==v | next; a=concat(vecextract(a,"^1"),unused[i]);unused=vecextract(unused,Str("^",i));next(2));L++;while(apply(x->gcd(x,L),a) !=v,unused=concat(unused,L++-1););a=concat(vecextract(a,"^1"),L))
Comments