login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1)=1 and thereafter a(n) is the number of locations 1..n-1 which are visited last in a single path beginning at some location s, in which one proceeds from location i to i +- a(i) (within 1..n-1) until no further unvisited location is available.
3

%I #30 Aug 27 2023 04:37:13

%S 1,1,2,3,3,3,3,4,6,6,7,7,7,7,7,7,9,9,9,11,11,11,14,15,15,15,15,17,18,

%T 18,18,19,19,25,25,25,25,26,26,26,26,26,27,27,27,28,28,28,28,29,29,29,

%U 29,29,29,29,29,29,29,29,29,29,30,30,30,30,30,30,40,40

%N a(1)=1 and thereafter a(n) is the number of locations 1..n-1 which are visited last in a single path beginning at some location s, in which one proceeds from location i to i +- a(i) (within 1..n-1) until no further unvisited location is available.

%C A location can be visited no more than once in a single path.

%H Kevin Ryde, <a href="/A364882/b364882.txt">Table of n, a(n) for n = 1..246</a>

%H Kevin Ryde, <a href="/A364882/a364882.c.txt">C Code</a>

%e a(9)=6 because there are 6 locations which can be visited last (as a dead end) among i=1..8. The 6 locations are i=1,2,3,5,7,8. The following shows a path in which the last location is i=5, beginning at location s=8:

%e 1 2 3 4 5 6 7 8 location number i

%e 1,1,2,3,3,3,3,4 a(i)

%e 1<----3<------4

%e 1>1>2-->3

%e From i=5, the only jumps are back to i=1 or forward to i=8, both of which were already visited, so i=5 is one possible dead end term. Here is a path illustrating how i=7 can be a dead end term. We begin at s=4.

%e 1 2 3 4 5 6 7 8 location number i

%e 1,1,2,3,3,3,3,4 a(i)

%e 3---->3

%e From i=7, we can only jump back to i=4, which was already visited, so i=7 is a dead end term. There are 4 other locations which can be last (or dead ends), for a total of 6 such locations, so a(9)=6.

%Y Cf. A364392, A360744, A360593.

%K nonn

%O 1,3

%A _Neal Gersh Tolunsky_, Aug 11 2023

%E More terms from _Kevin Ryde_, Aug 26 2023