|
Search: id:A123882
|
|
|
| A123882 |
|
a(1)=1, a(2)=2. a(n) = the smallest positive integer from among those integers not occurring earlier in the sequence and which are coprime to the second largest term occurring earlier in the sequence. |
|
+0 2
|
|
| 1, 2, 3, 5, 4, 7, 6, 11, 8, 9, 10, 13, 12, 17, 14, 15, 16, 19, 18, 23, 20, 21, 22, 25, 24, 29, 26, 27, 28, 31, 30, 37, 32, 33, 34, 35, 36, 41, 38, 39, 40, 43, 42, 47, 44, 45, 46, 49, 48, 53, 50, 51, 52, 55, 54, 59, 56, 57, 58, 61, 60, 67, 62, 63, 64, 65, 66, 71, 68, 69, 70, 73
(list; graph; listen)
|
|
|
OFFSET
|
1,2
|
|
|
COMMENT
|
Sequence is a permutation of the positive integers.
|
|
EXAMPLE
|
The second largest integer among the first 8 terms of the sequence is 7. Those positive terms not occurring among the first 8 terms form the sequence 8,9, 10,12,13,... Of these, 8 is the smallest which is coprime to 7. So a(9)=8.
|
|
MATHEMATICA
|
f[l_List] := Block[{s = Sort[l][[ -2]], k = 1}, While[GCD[k, s] > 1 || MemberQ[l, k], k++ ]; Append[l, k]]; Nest[f, {1, 2}, 75] (*Chandler*)
|
|
CROSSREFS
|
Cf. A123883.
Sequence in context: A100282 A100281 A064707 this_sequence A102454 A085790 A117120
Adjacent sequences: A123879 A123880 A123881 this_sequence A123883 A123884 A123885
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Leroy Quet (qq-quet(AT)mindspring.com), Oct 16 2006
|
|
EXTENSIONS
|
Extended by Ray Chandler (rayjchandler(AT)sbcglobal.net), Oct 16 2006
|
|
|
Search completed in 0.002 seconds
|