

A308021


Start at n=1. Fill in a(n) with a value d > 0 not used earlier such that nd or n+d is the smallest possible index not visited earlier, then continue with that index.


5



1, 2, 5, 3, 7, 10, 4, 6, 12, 15, 17, 8, 20, 9, 22, 11, 25, 27, 29, 14, 13, 33, 35, 37, 16, 40, 18, 19, 42, 45, 47, 49, 21, 24, 52, 55, 23, 58, 61, 62, 30, 26, 65, 66, 28, 68, 34, 31, 71, 74, 76, 79, 81, 39, 32, 83, 86, 36, 89, 43, 38, 91, 93, 96, 99, 41, 101, 50, 103, 106, 44, 108, 54, 111, 46, 113, 117, 48, 57, 118, 51, 120, 123
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

A variant of Recamán's sequence: start at n=1, a(1)=1, then iterate: let n' = n  a(n) if this n' > 0 and was not visited earlier, otherwise n' = n + a(n). Then let n'' <> n' be the smallest index not visited earlier (a(n'') not yet defined) such that the value n'n'' was not yet used (meaning not yet a value of any a(i)). Set a(n') = n'n'' and continue with n = n'. [Name and Comment suggested by M. F. Hasler at the request of the authors.]
Conjectured to be a permutation of the positive integers. The conjectured inverse permutation is given in A308049.  M. F. Hasler, May 10 2019
Comment from Rémy Sigrist and N. J. A. Sloane, May 13 2019 (Start):
The sequence is given by the following formula. Let R(t) = A081145(t). Then for all t >= 1, a(R(t)) = R(t+1)R(t).
For example, for t=10, R(10)=20, R(11)=6, and a(R(10)) = a(20) = 620 = 14.
Since it is known that {R(t): t>=1} is a permutation of the positive integers (it is the "SlaterVelez permutation of the first kind"), this specifies a(n) for all n.
The connection with the definition as interpreted above by M. F. Hasler is that at step t of the procedure, n' is R(t) = A081145(t), n'' is R(t+1) = A081145(t+1), and we calculate a(R(t)) = n'n'' = R(t)R(t+1).
The conjecture that {a(n)} is a permutation of the positive integers is equivalent to Slater and Velez's conjecture (see references) that the absolute values of the first differences of A081145 are also a permutation of the positive integers. This problem appears to be still unsolved. (End)


REFERENCES

P. J. Slater and W. Y. Velez, Permutations of the Positive Integers with Restrictions on the Sequence of Differences, II, Pacific Journal of Mathematics, Vol. 82, No. 2, 1979, 527531.


LINKS

JeanMarc Falcoz, Table of n, a(n) for n = 1..5564
P. J. Slater and W. Y. Velez, Permutations of the Positive Integers with Restrictions on the Sequence of Differences, Pacific Journal of Mathematics, Vol. 71, No. 1, 1977, 193196.
William Y. Velez, Research problems 159160, Discrete Math., 110 (1992), pp. 301302.


EXAMPLE

a(1) = 1 drives us to the empty cell a(2) since we can't go further to the left. We fill this cell with the number 2 which is the smallest integer not used before and thus allows us to go to the leftmost possible empty cell, 2 + 2 = 4. (There are no empty places to the left and we can't go to 3 = 2 + 1 since a step 1 has already been used.) So we have a(2) = 2.
a(2) = 2 drives us to the empty cell a(4). We see that the leftmost empty cell a(3) cannot be reached from a(4) since a step of 1 has already been used. We thus fill the cell a(4) with the smallest integer not used before, a(4) = 3.
a(4) = 3 drives us to the empty cell a(7). We see that the leftmost empty cell a(3) can now be reached from a(7) if we fill a(7) with 4; we have thus a(7) = 4.
a(7) = 4 drives us to the empty cell a(3), which is the one we wanted to fill. We fill a(3) with 5 which is the smallest integer not leading to a contradiction, whence a(3) = 5.
a(3) = 5 drives us to the empty cell a(8). We would like to fill this cell with 3, as this 3 would allow us to fill the leftmost empty cell of the sequence  but 3 has been used before; thus we'll have a(8) = 6.
a(8) = 6 drives us to the empty cell a(14). We fill a(14) with 9 as this will allow us to reach the leftmost empty cell of the sequence, whence a(14) = 9.
a(14) = 9 drives us to the empty cell a(5). We fill a(5) with 7 as this is the smallest integer not leading to a contradiction, so we have a(5) = 7, etc.


PROG

(PARI) {A=vector(N=199); n=1; while (n<=N, S=Set(A); Z=select(t>!t, A, 1); for (i=1, #Z, Z[i]!=nnext; setsearch(S, abs(nz=Z[i]))&& next; A[n]=abs(nz); n=z; next(2)); break); if(#Z, A[1..Z[1]!A[Z[1]]], A)} \\ M. F. Hasler, May 09 2019


CROSSREFS

Cf. A005132 (Recamán's sequence), A171884 (injective variant).
Cf. A308049 (conjectured inverse permutation).
See also A081145, A081146, A099004.
Sequence in context: A191671 A176707 A257533 * A333201 A191707 A192177
Adjacent sequences: A308018 A308019 A308020 * A308022 A308023 A308024


KEYWORD

base,nonn


AUTHOR

Eric Angelini and JeanMarc Falcoz, May 09 2019


STATUS

approved



