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.
%I A334052 #15 Dec 23 2020 07:47:03 %S A334052 1,0,1,2,3,2,2,1,5,3,3,1,4,2,7,3,5,5,1,7,5,3,6,5,3,3,1,8,4,3,4,2,18, %T A334052 10,17,12,8,9,8,2,8,2,2,1,17,7,16,20,5,7,4,9,14,13,3,12,7,7,1,15,3,6, %U A334052 31,25,5,16,7,9,7,2,27,15,12,17,29,2,6,15,6,2,4,30,18,15,6 %N A334052 Variant of Van Eck's sequence: Set a(1) = 1, a(2) = 0, a(3) = 1. Thereafter, a(n) is the minimum positive offset i from a(n-1) such that some partial sum a(n-1-i)+...+a(n-1-i+k) = a(n-1) (0 <= k < i). %C A334052 Conjecture: this sequence is defined. That is, each a(n-1) appears as a partial sum starting from some offset. %e A334052 For n=3 (the first term after the initial conditions), we are looking for a run that sums to a(2) = 1 (and doesn't include a(2)). The most recent such run starts at a(1) = 1, and goes for one place. So a(3) = 2, the distance from a(n-1) to the beginning of the run. %e A334052 For n=4, we are looking for a run that sums to 2. The last such run is a(1) + a(2) + a(3), at a distance of 3 away. so a(4) = 3. %o A334052 (Haskell) %o A334052 findSumRun target index runLength sum (x:xs) %o A334052 | sum == target = index + runLength %o A334052 | runLength == 0 = findSumRun target index 1 x (x:xs) %o A334052 | sum > target = findSumRun target (index+1) (runLength-1) (sum-x) xs %o A334052 | sum < target = findSumRun target index (runLength+1) (sum + ((x:xs)!!(runLength))) (x:xs) %o A334052 step (x:xs) = findSumRun x 0 0 0 xs %o A334052 seq 0 xs = xs %o A334052 seq n xs = ves (n-1) ((step xs):xs) %Y A334052 Similar to A181391. Along the same lines as A333210, which looks for pairs with a particular sum. By adding a restriction that the runs have a maximum length of 1, we recover Van Eck's sequence. %K A334052 nonn %O A334052 1,4 %A A334052 _Ethan Goldberg_, Sep 06 2020