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.

A289249 Number of compositions of n if only the order of parts 1 and 2 matters.

This page as a plain text file.
%I A289249 #36 May 11 2021 08:56:39
%S A289249 1,1,2,4,7,12,21,35,59,98,162,266,437,713,1163,1893,3077,4995,8105,
%T A289249 13139,21293,34492,55858,90438,146406,236974,383538,620703,1004471,
%U A289249 1625447,2630249,4256087,6886804,11143447,18030911,29175137,47206975,76383199,123591458
%N A289249 Number of compositions of n if only the order of parts 1 and 2 matters.
%C A289249 If only the order of parts 1 and 2 matters, then the remaining parts can be frozen "[]" in a partition subsequence; e.g., a(15) would count the sequence 5,4,3,2,1 twice: [5,4,3]2,1 and [5,4,3]1,2. (Also see example.)
%F A289249 a(n) = A000041(n) + A275388(n-2), the sum of the n-th partition number and the (n-2)th convolution of partition numbers with Fibonacci numbers. E.g., a(8) = 59 = A000041(8) + A275388(6) = 22 + 37 = 59.
%F A289249 a(n) = A275388(n+1) - A275388(n) - A275388(n-1) + A275388(n-2).
%F A289249 G.f.: (1/x)*(1-x)*(1-x^2)*(g.f. of A275388) =(1/x)*(1-x)*(1-x^2)*Sum_{k=1..n} A000045(k)*A000041(n-k).
%e A289249 For n=6, the 21 sequences counted are [6]; [5],1; [4],2; [3,3], [4],1,1; [3],2,1; [3],1,2; 2,2,2; [3],1,1,1; 2,2,1,1; 2,1,2,1; 1,2,2,1; 1,2,1,2; 1,1,2,2; 2,1,1,2; 2,1,1,1,1; 1,2,1,1,1; 1,1,2,1,1; 1,1,1,2,1; 1,1,1,1,2; and 1,1,1,1,1,1.
%t A289249 Table[PartitionsP[n] + Sum[Fibonacci[k] PartitionsP[n - 2 - k], {k, n - 2}], {n, 0, 50}] (* _Indranil Ghosh_, Jun 29 2017 *)
%o A289249 (PARI) a275388(n)=sum(k=1, n, fibonacci(k)*numbpart(n - k));
%o A289249 a(n)=numbpart(n)+a275388(n - 2); \\ _Indranil Ghosh_, Jun 29 2017
%o A289249 (Python)
%o A289249 from sympy import fibonacci, npartitions
%o A289249 def a(n): return npartitions(n) + sum([fibonacci(k)*npartitions(n - 2 - k) for k in range(1, n - 1)])
%o A289249 print([a(n) for n in range(51)]) # _Indranil Ghosh_, Jun 29 2017
%Y A289249 Cf. A000041, A000045, A275388.
%K A289249 nonn
%O A289249 0,3
%A A289249 _Gregory L. Simay_, Jun 29 2017
%E A289249 More terms from _Indranil Ghosh_, Jun 29 2017