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.

Showing 1-2 of 2 results.

A227113 Lexicographically earliest permutation of the natural numbers such that all pairs of even- and odd-indexed terms have a common divisor > 1.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 7, 14, 8, 12, 9, 15, 11, 22, 13, 26, 16, 18, 17, 34, 19, 38, 20, 24, 21, 27, 23, 46, 25, 30, 28, 32, 29, 58, 31, 62, 33, 36, 35, 40, 37, 74, 39, 42, 41, 82, 43, 86, 44, 48, 45, 50, 47, 94, 49, 56, 51, 54, 52, 60, 53, 106, 55, 65, 57, 63
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 01 2013

Keywords

Comments

a(2*n) = smallest number not occurring earlier;
a(2*n+1) = smallest number having with a(2*n) a common divisor greater than 1 and not occurring earlier;
A227288(n) = gcd(a(n), a(n+1)).

Examples

			.   n | a(2n) a(2n+1) | GCD |         not occurring after step n
.  ---+---------------+-----+-------------------------------------------
.   0 |    _      1   |   _ |  {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,..}
.   1 |    2      4   |   2 |  {3,5,6,7,8,9,10,11,12,13,14,15,16,17,..}
.   2 |    3      6   |   3 |  {5,7,8,9,10,11,12,13,14,15,16,17,18,19,..}
.   3 |    5     10   |   5 |  {7,8,9,11,12,13,14,15,16,17,18,19,20,..}
.   4 |    7     14   |   7 |  {8,9,11,12,13,15,16,17,18,19,20,21,22,..}
.   5 |    8     12   |   4 |  {9,11,13,15,16,17,18,19,20,21,22,23,24..}
.   6 |    9     15   |   3 |  {11,13,16,17,18,19,20,21,22,23,24,25,..}
.   7 |   11     22   |  11 |  {13,16,17,18,19,20,21,23,24,25,26,27,..}
.   8 |   13     26   |  11 |  {16,17,18,19,20,21,23,24,25,27,28,29,..}
.   9 |   16     18   |   2 |  {17,19,20,21,23,24,25,27,28,29,30,31,..} .
		

Crossrefs

Cf. A227114 (inverse).

Programs

  • Haskell
    import Data.List (delete)
    a227113 n = a227113_list !! (n-1)
    a227113_list = 1 : f [2..] where
       f (x:xs) = x : y : f (delete y xs)
         where y : _ = filter ((> 1) . (gcd x)) xs

Extensions

Thanks to Zak Seidov (who suggested more elaboration) from Reinhard Zumkeller, Jul 05 2013

A227289 Smallest m such that gcd(A227113(m+1), A227113(m)) = n.

Original entry on oeis.org

1, 2, 4, 10, 6, 177, 8, 514, 500, 349, 14, 4791, 16, 5949, 1623, 863, 20, 2629, 22, 5113, 2043, 3211, 28, 7347, 4593, 11911, 1647, 12819, 34, 27325, 36, 15755, 34527, 29319, 5459, 2797, 42, 24535, 20145, 15511, 46, 26523, 48, 64895, 13335, 40769, 54, 43835, 184041
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 05 2013

Keywords

Comments

A227288(a(n)) = n and A227288(m) <> n for m < a(n).

Examples

			.   n |   a(n) | A227288(a(n)) = gcd(A227113(a(n)),A227113(a(n)+1))
.  ---+--------+--------------- -----------------------------------
.   1 |     1  |            1  =  gcd(1,2)
.   2 |     2  |            2  =  gcd(2,4)
.   3 |     4  |            3  =  gcd(3,6)
.   4 |    10  |            4  =  gcd(8,12)
.   5 |     6  |            5  =  gcd(5,10)
.   6 |   177  |            6  =  gcd(168,162)
.   7 |     8  |            7  =  gcd(7,14)
.   8 |   514  |            8  =  gcd(472,480)
.   9 |   500  |            9  =  gcd(459,468)
.  10 |   349  |           10  =  gcd(330,320)
.  11 |    14  |           11  =  gcd(11,22)
.  12 |  4791  |           12  =  gcd(4524,4512)
		

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a227289 = (+ 1) . fromJust . (`elemIndex` a227288_list)
Showing 1-2 of 2 results.