A350359 Lexicographically earliest infinite sequence of distinct positive integers such that for any four consecutive terms a,b,c,d, d is prime to a and c, but not to b.
1, 2, 3, 4, 9, 8, 15, 14, 5, 7, 25, 21, 10, 27, 16, 33, 20, 11, 26, 77, 6, 35, 12, 49, 18, 91, 22, 13, 24, 65, 28, 55, 32, 45, 34, 39, 17, 57, 68, 19, 40, 133, 30, 119, 36, 161, 38, 23, 44, 69, 50, 51, 52, 63, 46, 75, 58, 81, 29, 93, 116, 31, 56, 155, 42, 85, 48, 95, 54, 115, 62
Offset: 1
Keywords
Examples
From the definition a(k)=k for 1 <= k <= 4. a(5) = 9 since 9 is prime to 2 and 4 but not to 3, and is the smallest number with this property. Likewise a(6) = 8 since 8 is prime to 3 and 9 but not to 4.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Simple annotated log-log plot of a(n) for n = 1..64, highlighting maxima and minima.
- Michael De Vlieger, Annotated log log scatterplot of a(n) for n = 1..2^10, showing records in red and local minima in blue, smallest missing numbers in fine gold points.
- Michael De Vlieger, Log log scatterplot of 50000 terms, exhibiting quasi-linear striations.
- Michael De Vlieger, Log log scatterplot of 50000 terms, highlighting primes in red, populating beta QLS.
- Michael De Vlieger, Log log scatterplot of 50000 terms highlighting even terms in red, odd in blue.
- Michael De Vlieger, Log log scatterplot of 50000 terms color coding the relationship between terms b and d.
Programs
-
Maple
N := 1000: a[1] := 1; a[2] := 2; a[3] := 3; a[4] := 4: R := {$5 .. N)}; for n from 5 while R <> {} do success := false; for r in R do if igcd(r, a[n-1]) = 1 and igcd(r, a[n-3]) = 1 and igcd(r, a[n-2]) > 1 then a[n] := r; R := R minus {r}; success := true; break fi od: if not success then break fi; od: seq(a[i], i = 1 .. n-1)
-
Mathematica
Nest[Block[{s = #, a, b, c, k = 4}, Set[{a, b, c}, #[[-3 ;; -1]]]; While[Nand[FreeQ[s, k], GCD[a, k] == 1, GCD[b, k] > 1, GCD[c, k] == 1], k++]; Append[s, k]] &, Range[3], 68] (* Michael De Vlieger, Dec 26 2021 *)
-
PARI
{ s=0; for (n=1, #a=vector(71), if (n<=3, a[n]=n, for (v=0, oo, if (!bittest(s,v) && gcd(v,a[n-2])>1 && gcd(v,lcm(a[n-3],a[n-1]))==1, a[n]=v; break))); s+=2^a[n]; print1(a[n]", ")) } \\ Rémy Sigrist, Mar 27 2022
Comments