cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A257218 Lexicographically earliest sequence of distinct positive integers such that gcd(a(n), a(n-1)) takes no value more than twice.

This page as a plain text file.
%I A257218 #37 Apr 27 2018 17:10:09
%S A257218 1,2,3,6,4,8,10,5,15,9,18,12,16,24,30,20,40,32,48,36,27,54,72,60,45,
%T A257218 75,25,50,70,7,14,28,42,21,63,126,84,56,112,64,96,120,80,100,150,90,
%U A257218 108,81,162,216,144,168,140,35,105,210,180,135,225,300
%N A257218 Lexicographically earliest sequence of distinct positive integers such that gcd(a(n), a(n-1)) takes no value more than twice.
%C A257218 Presumably a(n) is a permutation of the positive integers.
%C A257218 Primes seem to occur in their natural order. 31 appears as a(7060). Primes p >= 37 are not found among the first 10000 terms.
%C A257218 Numbers n such that a(n)=n are 1, 2, 3, 12, 306, ...
%C A257218 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
%C A257218 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
%H A257218 Ivan Neretin and Reinhard Zumkeller, <a href="/A257218/b257218.txt">Table of n, a(n) for n = 1..25000</a>, first 10000 terms from Ivan Neretin
%e A257218 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.
%t A257218 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 *)
%o A257218 (Haskell)
%o A257218 import Data.List (delete); import Data.List.Ordered (member)
%o A257218 a257218 n = a257218_list !! (n-1)
%o A257218 a257218_list = 1 : f 1 [2..] a004526_list where
%o A257218    f x zs cds = g zs where
%o A257218      g (y:ys) | cd `member` cds = y : f y (delete y zs) (delete cd cds)
%o A257218               | otherwise       = g ys
%o A257218               where cd = gcd x y
%o A257218 -- _Reinhard Zumkeller_, Apr 24 2015
%Y A257218 Other minimal sequences of distinct positive integers that match some condition imposed on a(n) and a(n-1):
%Y A257218 A175498 (differences are unique),
%Y A257218 A081145 (absolute differences are unique),
%Y A257218 A235262 (bitwise XORs are unique),
%Y A257218 A163252 (differ by one bit in binary),
%Y A257218 A000027 (GCD=1),
%Y A257218 A064413 (GCD>1),
%Y A257218 A128280 (sum is a prime),
%Y A257218 A034175 (sum is a square),
%Y A257218 A175428 (sum is a cube),
%Y A257218 A077220 (sum is a triangular number),
%Y A257218 A073666 (product plus 1 is a prime),
%Y A257218 A081943 (product minus 1 is a prime),
%Y A257218 A091569 (product plus 1 is a square),
%Y A257218 A100208 (sum of squares is a prime).
%Y A257218 Cf. A004526.
%Y A257218 Cf. A256918, A257120, A257475, A257478, A257122 (putative inverse).
%Y A257218 Cf. also A281978.
%K A257218 nonn,look
%O A257218 1,2
%A A257218 _Ivan Neretin_, Apr 18 2015