A377157 a(n) = n for n <= 3; for n > 3, a(n) is the smallest unused positive number that is coprime to a(n-1) if a(n-1) is prime and coprime to a(n-2) if a(n-2) is prime, else a(n) shares a factor with a(n-1) and a(n-2) if both are composite.
1, 2, 3, 5, 4, 6, 8, 10, 12, 14, 16, 18, 20, 15, 24, 9, 21, 27, 30, 33, 22, 11, 7, 13, 17, 19, 23, 25, 26, 40, 28, 32, 34, 36, 38, 42, 44, 46, 48, 50, 45, 35, 55, 60, 65, 39, 52, 54, 56, 58, 62, 64, 66, 68, 51, 72, 57, 63, 69, 75, 78, 70, 74, 76, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 85, 105, 95, 110, 114, 99, 81, 87, 93, 108, 111, 117, 120, 104
Offset: 1
Keywords
Examples
a(5) = 4 as both a(3) = 3 and a(4) = 5 are prime so a(5) must be coprime to both, and 4 is the smallest unused number coprime to both 3 and 5. a(6) = 6 as a(4) = 5 is prime so a(6) must be coprime to a(4), and 6 is the smallest unused number coprime to 5. a(7) = 8 as both a(5) = 4 and a(6) = 6 are composite so a(7) must share a factor with both, and 8 is the smallest unused number that shares a factor with both 4 and 6.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
- Scott R. Shannon, Image of the first 5000 terms. The terms are colored red, yellow, green, blue, violet if they have one, two, three, four, or five or more prime factors. The thin white line is a(n) = n.
- Scott R. Shannon, Image of the first 1000000 terms.
Comments