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-4 of 4 results.

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

Original entry on oeis.org

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, 75, 25, 50, 70, 7, 14, 28, 42, 21, 63, 126, 84, 56, 112, 64, 96, 120, 80, 100, 150, 90, 108, 81, 162, 216, 144, 168, 140, 35, 105, 210, 180, 135, 225, 300
Offset: 1

Views

Author

Ivan Neretin, Apr 18 2015

Keywords

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

Examples

			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.
		

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. A256918, A257120, A257475, A257478, A257122 (putative inverse).
Cf. also A281978.

Programs

  • 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
  • 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 *)

A256918 Greatest common divisors of adjacent terms in A257218.

Original entry on oeis.org

1, 1, 3, 2, 4, 2, 5, 5, 3, 9, 6, 4, 8, 6, 10, 20, 8, 16, 12, 9, 27, 18, 12, 15, 15, 25, 25, 10, 7, 7, 14, 14, 21, 21, 63, 42, 28, 56, 16, 32, 24, 40, 20, 50, 30, 18, 27, 81, 54, 72, 24, 28, 35, 35, 105, 30, 45, 45, 75, 100, 40, 32, 64, 48, 48, 36, 63, 189
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 25 2015

Keywords

Comments

a(n) = GCD(A257218(n),A257218(n+1)).
Each term occurs at most twice, and it is a plausible conjecture that every term will occur exactly twice.
A257120(n) = position of the first of not more than two occurrences of n: a(A257120(n)) = n;
A257475(n) = position of the second and last occurrence of n: a(A257475(n)) = n;
A257478(n) = distance of positions of first and second occurrence of n.

Crossrefs

Programs

  • Haskell
    a256918 n = a257218_list !! (n-1)
    a256918_list = zipWith gcd a257218_list $ tail a257218_list

A257475 Position of second and last occurrence of n in A256918.

Original entry on oeis.org

2, 6, 9, 12, 8, 14, 30, 17, 20, 28, 123, 23, 201, 32, 25, 39, 300, 46, 825, 43, 34, 125, 946, 51, 27, 203, 47, 52, 3094, 56, 7060, 62, 127, 302, 54, 71, 13528, 827, 205, 61, 28659, 79, 40811, 132, 58, 948, 46658, 65, 81, 99, 304, 210, 57450, 69, 134, 77, 829
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 25 2015

Keywords

Comments

GCD(A257218(a(n)),A257218(a(n)-1)) = n;
a(n) > A257120(n); a(n) = A257120 + A257478(n).

Examples

			Cf. A257478.
		

Crossrefs

Programs

  • Haskell
    a257475 n = f 1 a256918_list where
       f i (u:us) = (if u == n then g else f) (i + 1) us
       g j (v:vs) =  if v == n then j else g  (j + 1) vs

Extensions

a(38)-a(57) from Hiroaki Yamanouchi, May 03 2015

A257478 Distance of positions of first and last occurrence of n in A256918.

Original entry on oeis.org

1, 2, 6, 7, 1, 3, 1, 4, 10, 13, 1, 4, 1, 1, 1, 21, 1, 24, 1, 27, 1, 1, 1, 10, 1, 1, 26, 15, 1, 11, 1, 22, 1, 1, 1, 5, 1, 1, 1, 19, 1, 43, 1, 2, 1, 1, 1, 1, 1, 55, 1, 2, 1, 20, 1, 39, 1, 1, 1, 13, 1, 1, 32, 42, 1, 11, 1, 2, 1, 67, 1, 26
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 25 2015

Keywords

Comments

a(n) = A257475(n) - A257120(n).

Examples

			Let w(n) = A257218(n),
u(n) = A257120(n), xx'(n) = (w(u(n)),w(u(n)+1)),
v(n) = A257475(n), yy'(n) = (w(v(n)),w(v(n)+1)):
. ----+------+------+------++--------------+------------+---------+
.   n | a(n) | u(n) | v(n) ||       xx'(n) |     yy'(n) | ... gcd |
. ----+------+------+------++--------------+------------+---------+
.   1 |    1 |    1 |    2 ||     (1,   2) |   (2,   3) |       1 |
.   2 |    2 |    4 |    6 ||     (6,   4) |   (8,  10) |       2 |
.   3 |    6 |    3 |    9 ||     (3,   6) |  (15,   9) |       3 |
.   4 |    7 |    5 |   12 ||     (4,   8) |  (12,  16) |       4 |
.   5 |    1 |    7 |    8 ||    (10,   5) |   (5,  15) |       5 |
.   6 |    3 |   11 |   14 ||    (18,  12) |  (24,  30) |       6 |
.   7 |    1 |   29 |   30 ||    (70,   7) |   (7,  14) |       7 |
.   8 |    4 |   13 |   17 ||    (16,  24) |  (40,  32) |       8 |
.   9 |   10 |   10 |   20 ||     (9,  18) |  (36,  27) |       9 |
.  10 |   13 |   15 |   28 ||    (30,  20) |  (50,  70) |      10 |
.  11 |    1 |  122 |  123 ||   (660,  11) |  (11,  22) |      11 |
.  12 |    4 |   19 |   23 ||    (48,  36) |  (72,  60) |      12 |
.  13 |    1 |  200 |  201 ||  (1092,  13) |  (13,  26) |      13 |
.  14 |    1 |   31 |   32 ||    (14,  28) |  (28,  42) |      14 |
.  15 |    1 |   24 |   25 ||    (60,  45) |  (45,  75) |      15 |
.  16 |   21 |   18 |   39 ||    (32,  48) | (112,  64) |      16 |
.  17 |    1 |  299 |  300 ||  (2142,  17) |  (17,  34) |      17 |
.  18 |   24 |   22 |   46 ||    (54,  72) |  (90, 108) |      18 |
.  19 |    1 |  824 |  825 || (10260,  19) |  (19,  38) |      19 |
.  20 |   27 |   16 |   43 ||    (20,  40) |  (80, 100) |      20 |
.  21 |    1 |   33 |   34 ||    (42,  21) |  (21,  63) |      21 |
.  22 |    1 |  124 |  125 ||    (22,  44) |  (44,  66) |      22 |
.  23 |    1 |  945 |  946 || (12420,  23) |  (23,  46) |      23 |
.  24 |   10 |   41 |   51 ||    (96, 120) | (144, 168) |      24 |
.  25 |    1 |   26 |   27 ||    (75,  25) |  (25,  50) |      25 | .
		

Crossrefs

Programs

  • Haskell
    a257478 n = a257475 n - a257120 n

Extensions

a(37)-a(72) from Hiroaki Yamanouchi, May 03 2015
Showing 1-4 of 4 results.