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.

A078943 a(1)=1; a(n+1) is either a(n)-n or a(n)+n, where we choose the smallest positive integer that's not among the values a(1), ..., a(n).

This page as a plain text file.
%I A078943 #17 Aug 07 2023 05:31:21
%S A078943 1,2,4,7,3,8,14,21,13,22,12,23,11,24,10,25,9,26,44,63,43,64,42,19
%N A078943 a(1)=1; a(n+1) is either a(n)-n or a(n)+n, where we choose the smallest positive integer that's not among the values a(1), ..., a(n).
%C A078943 After a(24)=19, there are no more terms because a(24)-24 = -5 is not positive and a(24)+24 = 43 is equal to a(21).
%C A078943 If we only require that a(n+1) be either a(n)-n or a(n)+n, is there a sequence that contains every positive integer exactly once? I.e., can we take a walk on the positive integers starting at 1 and always moving (either left or right) a distance n on the n-th step so that we hit every positive integer exactly once?
%C A078943 A356080 is targeted to be such a sequence, but starting from 0. Its definition incorporates a limited look-ahead condition that is clearly a necessary condition for the sequence not to encounter a dead end (i.e., be finite) and is conjectured to be a sufficient condition. - _Peter Munn_, Feb 09 2023
%e A078943 a(9)=13, so a(10) is either 13-9=4 or 13+9=22. But 4 is not available since it equals a(3), so a(10)=22.
%Y A078943 Consists of terms 1 through 25 of A063733.
%Y A078943 Cf. A356080.
%K A078943 nonn,fini,full
%O A078943 1,2
%A A078943 _Leroy Quet_, Dec 15 2002
%E A078943 Edited by _Dean Hickerson_, Dec 18 2002