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.

A300760 Number of ways to select 4 numbers from the set of the first n natural numbers avoiding 3-term arithmetic progressions.

This page as a plain text file.
%I A300760 #38 Feb 18 2024 12:20:42
%S A300760 0,1,4,10,25,51,98,165,267,407,601,849,1175,1580,2089,2703,3452,4338,
%T A300760 5395,6622,8058,9706,11606,13758,16210,18963,22066,25520,29379,33645,
%U A300760 38376,43571,49293,55545,62391,69831,77937,86710,96223,106477,117550,129444,142241
%N A300760 Number of ways to select 4 numbers from the set of the first n natural numbers avoiding 3-term arithmetic progressions.
%H A300760 Heinrich Ludwig, <a href="/A300760/b300760.txt">Table of n, a(n) for n = 4..1000</a>
%H A300760 <a href="/index/Rec#order_11">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-1,0,-2,2,0,1,0,-2,1).
%F A300760 a(n) = (n^4 - 12*n^3 + 51*n^2 - 78*n + 32)/24 + b(n) + c(n), where
%F A300760   b(n) = 0          for n even
%F A300760   b(n) = (-n + 2)/4 for n odd
%F A300760   c(n) = 0          for n == 1,2,5,7,10,11 (mod 12)
%F A300760   c(n) = -1/3       for n == 3,6,9         (mod 12)
%F A300760   c(n) = -4/3       for n == 0             (mod 12)
%F A300760   c(n) = -1         for n == 4,8           (mod 12).
%F A300760 a(n) = (n^4 - 12*n^3 + 51*n^2 - 78*n + 32)/24 + (n == 1 (mod 2))*(-n + 2)/4 - (n == 0 (mod 3))/3 - (n == 0 (mod 4)).
%F A300760 From _Colin Barker_, Mar 12 2018: (Start)
%F A300760 G.f.: x^5*(1 + 2*x + 2*x^2 + 6*x^3 + 5*x^4 + 8*x^5) / ((1 - x)^5*(1 + x)^2*(1 + x^2)*(1 + x + x^2)).
%F A300760 a(n) = 2*a(n-1) - a(n-3) - 2*a(n-5) + 2*a(n-6) + a(n-8) - 2*a(n-10) + a(n-11) for n>14.
%F A300760 (End)
%e A300760 There are 4 selections of 4 natural numbers from the set {1,2,3,4,5,6} free of 3-term arithmetic progressions: {1,2,4,5}, {1,2,5,6}, {1,3,4,6}, {2,3,5,6}.
%t A300760 Array[(#^4 - 12 #^3 + 51 #^2 - 78 # + 32)/24 + Boole[OddQ@ #] (-# + 2)/4 - Boole[Mod[#, 3] == 0]/3 - Boole[Mod[#, 4] == 0] &, 43, 4] (* _Michael De Vlieger_, Mar 14 2018 *)
%t A300760 LinearRecurrence[{2,0,-1,0,-2,2,0,1,0,-2,1},{0,1,4,10,25,51,98,165,267,407,601},50] (* _Harvey P. Dale_, Feb 18 2024 *)
%o A300760 (PARI) concat(0, Vec(x^5*(1 + 2*x + 2*x^2 + 6*x^3 + 5*x^4 + 8*x^5) / ((1 - x)^5*(1 + x)^2*(1 + x^2)*(1 + x + x^2)) + O(x^60))) \\ _Colin Barker_, Aug 06 2018
%Y A300760 Cf. A212964, A300761.
%Y A300760 Column k=4 of A334187.
%K A300760 nonn,easy
%O A300760 4,3
%A A300760 _Heinrich Ludwig_, Mar 12 2018