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.

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

This page as a plain text file.
%I A371214 #7 Mar 16 2024 15:21:48
%S A371214 0,1,7,2,22,3,45,4,76,5,115,6,18,8,216,9,279,10,350,11,429,12,516,13,
%T A371214 611,14,714,15,825,16,944,17,47,19,1205,20,1348,21,55,23,1657,24,1824,
%U A371214 25,1999,26,2182,27,2373,28,2572,29,2779,30,2994,31,3217,32,3448
%N A371214 Lexicographically earliest sequence of distinct nonnegative integers such that for any n > 0, a(n-1) + a(n) is a multiple of n, and the least value not yet in the sequence appears as soon as possible.
%C A371214 To build the sequence:
%C A371214 - we start with a(0) = 0, and repeatedly:
%C A371214 - let a(n) be the last known term and v the least value not yet in the sequence,
%C A371214 - if a(n) + v is a multiple of n+1 then a(n+1) = v,
%C A371214 - 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).
%C A371214 The construction is similar to that of A367288.
%C A371214 This sequence is a variant of A099506 and, by design, is guaranteed to be a permutation of the nonnegative integers (with inverse A371215).
%H A371214 Rémy Sigrist, <a href="/A371214/a371214.gp.txt">PARI program</a>
%H A371214 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e A371214 The first terms are:
%e A371214   n   a(n)  (a(n-1) + a(n))/n
%e A371214   --  ----  -----------------
%e A371214    0     0  N/A
%e A371214    1     1                  1
%e A371214    2     7                  4
%e A371214    3     2                  3
%e A371214    4    22                  6
%e A371214    5     3                  5
%e A371214    6    45                  8
%e A371214    7     4                  7
%e A371214    8    76                 10
%e A371214    9     5                  9
%e A371214   10   115                 12
%e A371214   11     6                 11
%e A371214   12    18                  2
%o A371214 (PARI) See Links section.
%Y A371214 Cf. A099506, A367288, A371215 (inverse).
%K A371214 nonn
%O A371214 0,3
%A A371214 _Rémy Sigrist_, Mar 15 2024