login
A variant of Van Eck's sequence where we start with the value 0, and then alternatively add values to the right and to the left; the sequence lists the values as they are added.
1

%I #14 Dec 25 2024 02:02:08

%S 0,0,1,0,1,1,4,0,2,0,1,3,0,6,0,1,5,0,4,6,3,16,0,4,15,0,4,4,2,10,0,4,2,

%T 2,21,0,5,10,4,6,10,35,0,6,2,6,1,18,0,3,19,0,8,0,1,4,12,0,2,7,0,6,8,5,

%U 40,0,4,14,0,4,7,65,0,2,20,0,5,20,76,0,2

%N A variant of Van Eck's sequence where we start with the value 0, and then alternatively add values to the right and to the left; the sequence lists the values as they are added.

%C The construction described here gives a variant f of Van Eck's sequence with domain Z, and a(n) = f(A001057(n)).

%C When a value v has already appeared before, then the next value is the least distance to a similar value, otherwise the next value is 0.

%H Rémy Sigrist, <a href="/A350708/b350708.txt">Table of n, a(n) for n = 0..10000</a>

%H Rémy Sigrist, <a href="/A350708/a350708.png">Scatterplot of (A001057(n), a(n)) for n <= 1000000</a>

%H Rémy Sigrist, <a href="/A350708/a350708.gp.txt">PARI program</a>

%e The first steps of the construction are as follows:

%e n a(n) Values so far (including a(n))

%e -- ---- -------------------------------

%e 0 0 0

%e 1 0 0 0

%e 2 1 1 0 0

%e 3 0 1 0 0 0

%e 4 1 1 1 0 0 0

%e 5 1 1 1 0 0 0 1

%e 6 4 4 1 1 0 0 0 1

%e 7 0 4 1 1 0 0 0 1 0

%e 8 2 2 4 1 1 0 0 0 1 0

%e 9 0 2 4 1 1 0 0 0 1 0 0

%e 10 1 1 2 4 1 1 0 0 0 1 0 0

%o (PARI) See Links section.

%Y Cf. A001057, A181391.

%K nonn

%O 0,7

%A _Rémy Sigrist_, Mar 27 2022