OFFSET
1,2
COMMENTS
Presumably a(n) is a permutation of the positive integers.
Primes seem to occur in their natural order. 31 appears as a(7060). Primes p >= 37 are not found among the first 10000 terms.
Numbers n such that a(n)=n are 1, 2, 3, 12, 306, ...
A256918(n) = gcd(a(n), a(n+1)); gcd(a(A257120(n)), a(A257120(n)+1)) = gcd(a(A257475(n)), a(A257475(n)-1)) = n. - Reinhard Zumkeller, Apr 25 2015
For p prime: A257122(p)-1 = index of the smallest multiple of p: a(A257122(p)-1) mod p = 0 and a(m) mod p > 0 for m < A257122(p)-1. - Reinhard Zumkeller, Apr 26 2015
LINKS
Ivan Neretin and Reinhard Zumkeller, Table of n, a(n) for n = 1..25000, first 10000 terms from Ivan Neretin
EXAMPLE
After a(9)=15, the values 1, 2, 3, 4, 6, and 8 are already used, while 7 is forbidden because gcd(15,7)=1 and that value of GCD has already occurred twice, at (1,2) and (2,3). The minimal value which is neither used not forbidden is 9, so a(10)=9.
MATHEMATICA
a={1}; used=Array[0&, 10000]; Do[i=1; While[MemberQ[a, i] || used[[l=GCD[a[[-1]], i]]]>=2, i++]; used[[l]]++; AppendTo[a, i], {n, 2, 100}]; a (* Ivan Neretin, Apr 18 2015 *)
PROG
(Haskell)
import Data.List (delete); import Data.List.Ordered (member)
a257218 n = a257218_list !! (n-1)
a257218_list = 1 : f 1 [2..] a004526_list where
f x zs cds = g zs where
g (y:ys) | cd `member` cds = y : f y (delete y zs) (delete cd cds)
| otherwise = g ys
where cd = gcd x y
-- Reinhard Zumkeller, Apr 24 2015
CROSSREFS
Other minimal sequences of distinct positive integers that match some condition imposed on a(n) and a(n-1):
A175498 (differences are unique),
A081145 (absolute differences are unique),
A235262 (bitwise XORs are unique),
A163252 (differ by one bit in binary),
A000027 (GCD=1),
A064413 (GCD>1),
A128280 (sum is a prime),
A034175 (sum is a square),
A175428 (sum is a cube),
A077220 (sum is a triangular number),
A073666 (product plus 1 is a prime),
A081943 (product minus 1 is a prime),
A091569 (product plus 1 is a square),
A100208 (sum of squares is a prime).
Cf. A004526.
Cf. also A281978.
KEYWORD
nonn,look
AUTHOR
Ivan Neretin, Apr 18 2015
STATUS
approved