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.

A357256 "Forest Fire" sequence with the additional condition that no progression of the form ABA is allowed for any terms A and B.

This page as a plain text file.
%I A357256 #31 Jul 23 2025 16:04:07
%S A357256 1,1,2,2,4,4,5,3,3,5,6,6,7,10,10,7,9,12,11,9,12,8,8,14,14,11,15,13,13,
%T A357256 17,23,20,16,15,17,23,24,16,18,18,19,26,21,28,25,19,22,22,29,24,20,30,
%U A357256 27,21,32,29,30,35,26,34,36,25,31,32,34,37,39,36,28,27
%N A357256 "Forest Fire" sequence with the additional condition that no progression of the form ABA is allowed for any terms A and B.
%C A357256 It is easy to see that a number can occur no more than twice: 1) If a number occurs twice, one term with that value must be at an odd n and the other at an even n. This is because otherwise you could always find a progression of the form ABA. 2) Once two terms of the same value are in the sequence on an even and odd n, no third term with that value can be added without creating a progression of form ABA.
%H A357256 Michael S. Branicky, <a href="/A357256/b357256.txt">Table of n, a(n) for n = 1..10000</a>
%e A357256 a(4)=2 because if a(4) were 1 the 2-4th terms would be the ABA-form progression 1,2,1. 2 here is the smallest number which forms neither an arithmetic nor ABA progression.
%o A357256 (Python)
%o A357256 from itertools import count, islice
%o A357256 def agen(): # generator of terms
%o A357256     alst, mink, aba = [0], [1, 1], [set(), set()] # even, odd appearances
%o A357256     for n in count(1):
%o A357256         k = mink[n&1]
%o A357256         ff = set(2*alst[n-i] - alst[n-2*i] for i in range(1, (n+1)//2))
%o A357256         while k in ff or k in aba[n&1]: k += 1
%o A357256         alst.append(k); aba[n&1].add(k); yield k
%o A357256         while mink[n&1] in aba[n&1]: mink[n&1] += 1
%o A357256 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Dec 12 2022
%Y A357256 Cf. A229037.
%K A357256 nonn
%O A357256 1,3
%A A357256 _Neal Gersh Tolunsky_, Dec 11 2022
%E A357256 More terms from _Michael S. Branicky_, Dec 12 2022