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.

A242921 Lexicographically least increasing sequence avoiding double 3-term arithmetic progressions.

This page as a plain text file.
%I A242921 #24 Nov 09 2017 08:46:11
%S A242921 0,1,3,4,7,8,10,11,15,17,18,20,25,27,28,31,32,34,35,38,42,43,45,46,53,
%T A242921 55,58,59,61,62,67,68,70,71,79,81,85,87,90,92,93,98,102,105,112,114,
%U A242921 115,119,121,126,129,130,132,133,136,140,141,143,144,148
%N A242921 Lexicographically least increasing sequence avoiding double 3-term arithmetic progressions.
%C A242921 a(0) = 0, a(1) = 1, and for n >= 2, a(n) is the least integer t > a(n-1) such that for all 0 < i <= n/2 we have a(n-2i)+t <> 2a(n-i).
%C A242921 By double arithmetic sequence it is meant that both the indices and the values are in arithmetic progression.
%H A242921 Alois P. Heinz, <a href="/A242921/b242921.txt">Table of n, a(n) for n = 0..10000</a>
%H A242921 T. Brown, V. Jungic, and A. Poelstra, <a href="http://arxiv.org/abs/1304.1829">On double 3-term arithmetic progressions</a>, arxiv preprint, November 2013.
%e A242921 a(8) = 15: 12 is not in the sequence because a(6) = 10, a(7) = 11; 13 is not in the sequence because a(4) = 7, a(6) = 10; 14 is not in the sequence because a(0) = 0, a(4) = 7, so a(8) = 15.
%p A242921 a:= proc(n) option remember; local i, t, ok;
%p A242921       if n<2 then n
%p A242921     else for t from 1+a(n-1) do ok:=true;
%p A242921            for i to n/2 while ok
%p A242921              do ok:=a(n-2*i)+t <> 2*a(n-i) od;
%p A242921            if ok then return t fi
%p A242921          od
%p A242921       fi
%p A242921     end:
%p A242921 seq(a(n), n=0..100);  # _Alois P. Heinz_, May 26 2014
%t A242921 a[n_] := a[n] = Module[{i, t, ok}, If[n<2, n, For[t = 1+a[n-1], True, t++, ok = True; i = 1; While[ok && i <= n/2, ok = a[n-2*i]+t != 2*a[n-i]; i++]; If[ok, Return[t]]]]];
%t A242921 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Nov 09 2017, after _Alois P. Heinz_ *)
%Y A242921 Differs from A094870 in that sequence must be increasing.
%Y A242921 Cf. A003278, A229037.
%K A242921 nonn
%O A242921 0,3
%A A242921 _Jeffrey Shallit_, May 26 2014