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 A238432 #18 May 21 2018 06:39:50 %S A238432 1,1,2,3,7,13,22,41,74,133,233,400,714,1209,2091,3591,6089,10316, %T A238432 17477,29413,49515,82474,137659,228461,377936,623710,1025445,1680418, %U A238432 2746242,4474654,7270430,11774128,19020802,30640812,49222427,78857338,126033488,200872080 %N A238432 Number of compositions of n avoiding equidistant 3-term arithmetic progressions. %H A238432 Joerg Arndt and Alois P. Heinz, <a href="/A238432/b238432.txt">Table of n, a(n) for n = 0..45</a> %e A238432 The a(5) = 13 such compositions are: %e A238432 01: [ 1 1 2 1 ] %e A238432 02: [ 1 1 3 ] %e A238432 03: [ 1 2 1 1 ] %e A238432 04: [ 1 2 2 ] %e A238432 05: [ 1 3 1 ] %e A238432 06: [ 1 4 ] %e A238432 07: [ 2 1 2 ] %e A238432 08: [ 2 2 1 ] %e A238432 09: [ 2 3 ] %e A238432 10: [ 3 1 1 ] %e A238432 11: [ 3 2 ] %e A238432 12: [ 4 1 ] %e A238432 13: [ 5 ] %e A238432 Note that the first and third composition contain the progression 1,1,1, but not in equidistant positions. %p A238432 b:= proc(n, l) local j; %p A238432 for j from 2 to iquo(nops(l)+1, 2) do %p A238432 if l[1]-l[j]=l[j]-l[2*j-1] then return 0 fi od; %p A238432 `if`(n=0, 1, add(b(n-i, [i, l[]]), i=1..n)) %p A238432 end: %p A238432 a:= n-> b(n, []): %p A238432 seq(a(n), n=0..20); %t A238432 b[n_, l_] := b[n, l] = Module[{j}, For[j = 2, j <= Quotient[Length[l] + 1, 2], j++, If[l[[1]] - l[[j]] == l[[j]] - l[[2*j - 1]], Return[0]]]; If[n == 0, 1, Sum[b[n - i, Prepend[l, i]], {i, 1, n}]]]; %t A238432 a[n_] := b[n, {}]; %t A238432 Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, May 21 2018, translated from Maple *) %Y A238432 Cf. A238433 (same for partitions). %Y A238432 Cf. A238569 (compositions avoiding any 3-term arithmetic progression). %Y A238432 Cf. A238423 (compositions avoiding three consecutive parts in arithmetic progression). %Y A238432 Cf. A238686. %K A238432 nonn %O A238432 0,3 %A A238432 _Joerg Arndt_ and _Alois P. Heinz_, Mar 01 2014