A354075 Lexicographically earliest infinite sequence of distinct positive integers such that A(a(n+1)) is prime to A(a(n)) but not to A(a(n-1)), where A is A001414.
2, 3, 4, 14, 15, 20, 16, 24, 18, 26, 33, 5, 7, 6, 10, 21, 12, 8, 94, 9, 124, 27, 25, 38, 30, 62, 32, 11, 35, 28, 36, 40, 39, 45, 42, 48, 44, 54, 46, 57, 86, 49, 74, 51, 13, 50, 22, 55, 56, 60, 63, 64, 75, 65, 80, 66, 90, 70, 96, 68, 69, 92, 84, 105, 85, 112, 87
Offset: 1
Keywords
Examples
a(4)=14 because A(14)=9 is prime to A(a(3))=4 but not to A(a(2))=3, and is the smallest number not already seen in the sequence which has this property.
Links
- Jinyuan Wang, Table of n, a(n) for n = 1..10000
Programs
-
PARI
f(n) = my(f=factor(n)); f[, 1]~*f[, 2]; \\ A001414 lista(nn) = {my(va = vector(nn)); va[1] = 2; va[2] = 3; for (n=3, nn, my(k=1); while ((gcd(f(va[n-1]), f(k)) != 1) || (gcd(f(va[n-2]), f(k)) == 1) || #select(x->(x==k), va), k++); va[n] = k;); va;} \\ Michel Marcus, Jun 12 2022
Extensions
Corrected and extended by Michel Marcus, Jun 12 2022
Comments