Skip to main content
Fixed a typo.
Source Link
Erik the Outgolfer
  • 40.6k
  • 5
  • 45
  • 122

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.
  • a(1) = 1
  • a(2) = 2
  • a(n) is the mallestsmallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Task

  • Given positive integer n, output/print a(n).

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.
  • a(1) = 1
  • a(2) = 2
  • a(n) is the mallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Task

  • Given positive integer n, output/print a(n).

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.
  • a(1) = 1
  • a(2) = 2
  • a(n) is the smallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Task

  • Given positive integer n, output/print a(n).

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

added 52 characters in body
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.

Task

  • a(1) = 1
  • a(2) = 2
  • a(n) is the mallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Task

  • Given positive integer n, output/print a(n).

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.

Task

  • a(1) = 1
  • a(2) = 2
  • a(n) is the mallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.
  • a(1) = 1
  • a(2) = 2
  • a(n) is the mallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Task

  • Given positive integer n, output/print a(n).

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

added 176 characters in body
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.

Task

  • a(1) = 1
  • a(2) = 2
  • a(n) is the mallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

Definition

  • Two integers are coprime if they share no positive common divisors other than 1.

Task

  • a(1) = 1
  • a(2) = 2
  • a(n) is the mallest positive integer which is coprime to the a(n-1) and a(n-2) and has not yet appeared, for integer n >= 3.

Example

  • a(11) = 6 because 6 is coprime with the last two predecessors (namely, 11 and 13) and 6 has not appeared before.

Notes

  • Note that the sequence is not ascending, meaning that an element can be smaller than its predecessor.

Specs

  • You must use 1-indexed.

Testcases

n      a(n)
1      1
2      2
3      3
4      5
5      4
6      7
7      9
8      8
9      11
10     13
11     6
12     17
13     19
14     10
15     21
16     23
17     16
18     15
19     29
20     14
100    139
1000   1355
10000  13387
100000 133361

Scoring

  • Since coprime means that the two numbers share only one divisor (1), and 1 is a small number, your code should be as small as possible in terms of byte-count.

References

edited tags
Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284
Loading
edited tags
Link
Adnan
  • 44.5k
  • 6
  • 82
  • 246
Loading
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284
Loading