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.

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

This page as a plain text file.
%I A367290 #11 Nov 13 2023 17:50:30
%S A367290 1,5,2,17,3,69,4,310,6,558,7,193,8,869,9,2077,10,1780,11,3562,12,961,
%T A367290 13,6155,14,2439,15,8255,16,6120,18,12464,19,9472,20,11195,21,4260,22,
%U A367290 24070,23,16133,24,18360,25,19528,26,27456,27,25905,28,46395,29,6054
%N A367290 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, a(n) and a(n+1) are congruent modulo the n-th prime number, and the least value not yet in the sequence appears as soon as possible.
%C A367290 To build the sequence:
%C A367290 - we start with a(1) = 1, and repeatedly:
%C A367290 - let a(n) be the last known term and v the least value not yet in the sequence,
%C A367290 - if a(n) and v are congruent modulo the n-th prime number then a(n+1) = v,
%C A367290 - 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 two consecutive prime numbers are coprime).
%C A367290 This sequence is a variant of A364054, and, by design, is guaranteed to be a permutation of the positive integers (with inverse A367291).
%H A367290 Rémy Sigrist, <a href="/A367290/b367290.txt">Table of n, a(n) for n = 1..10000</a>
%H A367290 Rémy Sigrist, <a href="/A367290/a367290.gp.txt">PARI program</a>
%H A367290 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e A367290 The first terms are:
%e A367290   n   a(n)   a(n) mod prime(n)  a(n+1) mod prime(n)
%e A367290   --  -----  -----------------  -------------------
%e A367290    1      1                  1                    1
%e A367290    2      5                  2                    2
%e A367290    3      2                  2                    2
%e A367290    4     17                  3                    3
%e A367290    5      3                  3                    3
%e A367290    6     69                  4                    4
%e A367290    7      4                  4                    4
%e A367290    8    310                  6                    6
%e A367290    9      6                  6                    6
%e A367290   10    558                  7                    7
%e A367290   11      7                  7                    7
%e A367290   12    193                  8                    8
%e A367290   13      8                  8                    8
%o A367290 (PARI) See Links section.
%Y A367290 Cf. A364054, A367288, A367291 (inverse).
%K A367290 nonn
%O A367290 1,2
%A A367290 _Rémy Sigrist_, Nov 12 2023