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.

A238423 Number of compositions of n avoiding three consecutive parts in arithmetic progression.

This page as a plain text file.
%I A238423 #31 Jun 03 2019 09:15:36
%S A238423 1,1,2,3,7,13,22,42,81,149,278,516,971,1812,3374,6297,11770,21970,
%T A238423 41002,76523,142901,266779,497957,929563,1735418,3239698,6047738,
%U A238423 11289791,21076118,39344992,73448769,137113953,255965109,477835991,892023121,1665227859
%N A238423 Number of compositions of n avoiding three consecutive parts in arithmetic progression.
%C A238423 These are compositions of n whose second-differences are nonzero. - _Gus Wiseman_, Jun 03 2019
%H A238423 Joerg Arndt and Alois P. Heinz, <a href="/A238423/b238423.txt">Table of n, a(n) for n = 0..400</a>
%H A238423 Wikipedia, <a href="https://en.wikipedia.org/wiki/Arithmetic_progression">Arithmetic progression</a>
%F A238423 a(n) ~ c * d^n, where d = 1.866800016014240677813344121155900699..., c = 0.540817940878009616510727217687704495... - _Vaclav Kotesovec_, May 01 2014
%e A238423 The a(5) = 13 such compositions are:
%e A238423 01:  [ 1 1 2 1 ]
%e A238423 02:  [ 1 1 3 ]
%e A238423 03:  [ 1 2 1 1 ]
%e A238423 04:  [ 1 2 2 ]
%e A238423 05:  [ 1 3 1 ]
%e A238423 06:  [ 1 4 ]
%e A238423 07:  [ 2 1 2 ]
%e A238423 08:  [ 2 2 1 ]
%e A238423 09:  [ 2 3 ]
%e A238423 10:  [ 3 1 1 ]
%e A238423 11:  [ 3 2 ]
%e A238423 12:  [ 4 1 ]
%e A238423 13:  [ 5 ]
%p A238423 # b(n, r, d): number of compositions of n where the leftmost part j
%p A238423 #             does not have distance d to the recent part r
%p A238423 b:= proc(n, r, d) option remember; `if`(n=0, 1,
%p A238423       add(`if`(j=r+d, 0, b(n-j, j, j-r)), j=1..n))
%p A238423     end:
%p A238423 a:= n-> b(n, infinity, 0):
%p A238423 seq(a(n), n=0..45);
%t A238423 b[n_, r_, d_] := b[n, r, d] = If[n == 0, 1, Sum[If[j == r + d, 0, b[n - j, j, j - r]], {j, 1, n}]]; a[n_] := b[n, Infinity, 0]; Table[a[n], {n, 0, 45}] (* _Jean-François Alcover_, Nov 06 2014, after Maple *)
%t A238423 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[Differences[#,2],0]&]],{n,0,10}] (* _Gus Wiseman_, Jun 03 2019 *)
%Y A238423 Cf. A238424 (equivalent for partitions).
%Y A238423 Cf. A238569 (equivalent for any 3-term arithmetic progression).
%Y A238423 Cf. A238686, A295370.
%Y A238423 Cf. A007862, A049988, A175342, A325545, A325849, A325851, A325874, A325875.
%K A238423 nonn
%O A238423 0,3
%A A238423 _Joerg Arndt_ and _Alois P. Heinz_, Feb 26 2014