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

A352714 Inverse permutation to A352713.

Original entry on oeis.org

0, 1, 2, 4, 3, 6, 8, 10, 5, 12, 14, 16, 18, 20, 22, 24, 7, 26, 19, 28, 13, 30, 32, 34, 9, 36, 38, 40, 42, 44, 46, 48, 11, 50, 43, 52, 15, 54, 56, 58, 27, 60, 62, 64, 66, 68, 70, 72, 17, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 21, 104, 67
Offset: 0

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

Graphically, the sequence has similarities with A279125.

Examples

			A352713(42) = 28, so a(28) = 42.
		

Crossrefs

Programs

  • PARI
    See Links section.

A367288 Lexicographically earliest sequence of distinct nonnegative integers such that for any n > 0, a(n-1) and a(n) are congruent modulo n, and the least value not yet in the sequence appears as soon as possible.

Original entry on oeis.org

0, 1, 5, 2, 18, 3, 39, 4, 60, 6, 106, 7, 151, 8, 204, 9, 265, 10, 334, 11, 411, 12, 496, 13, 589, 14, 690, 15, 799, 16, 916, 17, 1009, 19, 1175, 20, 1316, 21, 1465, 22, 1622, 23, 1787, 24, 1960, 25, 2141, 26, 2330, 27, 2527, 28, 2732, 29, 2945, 30, 3166, 31
Offset: 0

Views

Author

Rémy Sigrist, Nov 12 2023

Keywords

Comments

To build the sequence:
- we start with a(0) = 0, and repeatedly:
- let a(n) be the last known term and v the least value not yet in the sequence,
- if a(n) and v are congruent modulo n+1 then a(n+1) = v,
- otherwise a(n+2) = v and a(n+1) is chosen as small as possible in such a way as to satisfy the required congruences (this is always possible as n+1 and n+2 are coprime).
This construction is similar to that of A352713.
This sequence is a variant of A125717 and, by design, is guaranteed to be a permutation of the nonnegative integers (with inverse A367289).

Examples

			The first terms are:
  n   a(n)  a(n-1) mod n  a(n) mod n
  --  ----  ------------  ----------
   0     0  N/A           N/A
   1     1             0           0
   2     5             1           1
   3     2             2           2
   4    18             2           2
   5     3             3           3
   6    39             3           3
   7     4             4           4
   8    60             4           4
   9     6             6           6
  10   106             6           6
  11     7             7           7
  12   151             7           7
  13     8             8           8
		

Crossrefs

Programs

  • PARI
    See Links section.

A355212 A variant of the EKG sequence (A064413) where the least value not yet in the sequence appears as soon as possible.

Original entry on oeis.org

1, 2, 6, 3, 12, 4, 10, 5, 35, 7, 14, 8, 18, 9, 33, 11, 143, 13, 39, 15, 20, 16, 34, 17, 323, 19, 57, 21, 24, 22, 46, 23, 115, 25, 30, 26, 36, 27, 42, 28, 58, 29, 899, 31, 62, 32, 74, 37, 148, 38, 40, 82, 41, 1763, 43, 86, 44, 48, 45, 141, 47, 329, 49, 56, 50
Offset: 1

Views

Author

Rémy Sigrist, Jun 24 2022

Keywords

Comments

To build the sequence:
- we start with a(1) = 1 and a(2) = 2, and then repeatedly:
- let a(n) be the last known term and v the least value not yet in the sequence,
- if gcd(a(n), v) > 1
then a(n+1) = v,
- otherwise:
- let w be the least value not yet in the sequence such that gcd(a(n), w) > 1
and gcd(w, v) > 1,
- then a(n+1) = w and a(n+2) = v.
This sequence is a permutation of the positive integers with inverse A355213.
The construction is similar to that of A352713.

Examples

			The first terms are (stars correspond to "w" terms):
  n   a(n)  w
  --  ----  -
   1     1
   2     2
   3     6  *
   4     3
   5    12  *
   6     4
   7    10  *
   8     5
   9    35  *
  10     7
  11    14  *
  12     8
  13    18  *
  14     9
  15    33  *
  16    11
		

Crossrefs

Cf. A064413, A352713, A355213 (inverse).

Programs

  • PARI
    \\ See Links section.
    
  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        aset, an, v = {1, 2}, 2, 3; yield from [1, 2]
        for n in count(3):
            if gcd(an, v) == 1:
                w = v + 1
                while w in aset or gcd(an, w) == 1 or gcd(w, v) == 1: w += 1
                aset.add(w); yield w
            an = v; aset.add(an); yield an
            while v in aset: v += 1
    print(list(islice(agen(), 65))) # Michael S. Branicky, Jun 24 2022
Showing 1-3 of 3 results.