%I #64 Aug 04 2024 17:08:44
%S 0,0,0,0,0,0,2,4,8,12,20,28,40,52,70,88,112,136,168,200,240,280,330,
%T 380,440,500,572,644,728,812,910,1008,1120,1232,1360,1488,1632,1776,
%U 1938,2100,2280,2460,2660,2860,3080,3300,3542,3784,4048,4312,4600,4888,5200
%N Multiplicity of K_3 in K_n.
%C The multiplicity of triangles in K_n is defined to be the minimum number of monochromatic copies of K_3 that occur in any 2-coloring of the edges of K_n. - _Allan Bickle_, Mar 04 2023
%C Twice A008804 (up to offset).
%C From _Alexander Adamchuk_, Nov 29 2006: (Start)
%C n divides a(n) for n = {1,2,3,4,5,8,10,13,14,16,17,20,22,25,26,28,29,32,34,37,38,40,41,44,46,49,50,52,53,56,58,61,62,64,65,68,70,73,74,76,77,80,82,85,86,88,89,92,94,97,98,100,...}.
%C Prime p divides a(p) for p = {2,3,5,13,17,29,37,41,53,61,73,89,97,101,109,113,137,149,157,173,181,193,197,...} = (2,3) and all primes from A002144: Pythagorean primes: primes of form 4n+1.
%C (n+1) divides a(n) for n = {1,2,3,4,5,19,27,43,51,67,75,91,99,...}.
%C (p+1) divides a(p) for prime p = {2,3,5,19,43,67,139,163,211,283,307,331,379,499,523,547,571,619,643,691,739,787,811,859,883,907,...} = {2,5} and all primes from A141373: Primes of the form 3x^2+16y^2.
%C (n-1) divides a(n) for n = {2,3,4,5,21,29,45,53,69,77,93,101,...}.
%C (p-1) divides a(p) for prime p = {2,3,5,29,53,101,149,173,197,269,293,317,389,461,509,557,653,677,701,773,797,821,941,..} = {2,3} and all primes from A107003: Primes of the form 5x^2+2xy+5y^2, with x and y any integer.
%C (n-2) divides a(n) for n = {3,4,5,12,16,24,28,36,40,48,52,60,64,72,76,84,88,96,100,...} = {3,5} and 4*A032766: Numbers congruent to 0 or 1 mod 3.
%C (n+3) divides a(n) for n = {1,2,3,4,5,9,11,18,32,39}.
%C (n-3) divides a(n) for n = {4,5,7,9,23,31,47,55,71,79,95,103,119,127,143,151,167,175,...}.
%C (p+3) divides a(p) for prime p = {5,7,23,31,47,71,79,103,127,151,167,191,199,...} = {5} and all primes from A007522: Primes of form 8n+7.
%C (n-4) divides a(n) for n = {5,6,8,11,12,14,15,18,20,23,24,26,27,30,32,35,36,38,39,42,44,47,48,50,...}.
%C (p-4) divides a(p) for prime p = {5,11,23,47,59,71,83,107,131,167,179,191,...} = {5} and all primes from A068231: Primes congruent to 11 (mod 12).
%C (n+5) divides a(n) for n = {1,2,3,4,5,30,31,45,58,145}.
%C (n-5) divides a(n) for n = {6,7,9,10,20,25,33,49,57,73,81,97,105,...}.
%C (p-5) divides a(p) for prime p = {7,73,97,193,241,313,337,409,433,457,577,601,673,769,937,...} = {7} and all primes from A107008: Primes of the form x^2+24y^2. (End)
%H Alexander Adamchuk, <a href="/A014557/b014557.txt">Table of n, a(n) for n = 0..100</a>
%H R. Ehrenborg, <a href="https://doi.org/10.1080/0025570X.2021.1977581">Bounding monochromatic triangles using squares</a>, Math. Magazine, 94 (2021), 383-386.
%H A. W. Goodman, <a href="http://www.jstor.org/stable/2310464">On Sets of Acquaintances and Strangers at Any Party</a>, Amer. Math. Monthly 66, 778-783, 1959.
%H L. Sauvé, <a href="https://www.jstor.org/stable/2312470">On chromatic graphs</a>, Amer. Math. Monthly, 68 (1961), 107-111.
%H A. J. Schwenk, <a href="https://www.tandfonline.com/doi/abs/10.1080/00029890.1972.11993198">Acquaintance Party Problem</a>, Amer. Math. Monthly 79 (1972), 1113-1117.
%H V. Vijayalakshmi, <a href="https://doi.org/10.1016/S0012-365X(98)00410-5">Multiplicity of triangles in cocktail party graphs</a>, Discrete Math., 206 (1999), 217-218.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/ExtremalGraph.html">Extremal Graph.</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/MonochromaticForcedTriangle.html">Monochromatic Forced Triangle.</a>
%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,2,-2,0,2,-1).
%F a(n) = binomial(n,3) - floor(n/2 * floor(((n-1)/2)^2)). - _Alexander Adamchuk_, Nov 29 2006
%F G.f.: 2*x^6/((x-1)^4*(x+1)^2*(x^2+1)). - _Colin Barker_, Nov 28 2012
%F E.g.f.: ((x - 3)*x^2*cosh(x) - 6*sin(x) + (6 + 3*x - 3*x^2 + x^3)*sinh(x))/24. - _Stefano Spezia_, May 15 2023
%e Any 2-coloring of the edges of K_6 produces at least two monochromatic triangles. Having colors induce K_3,3 and 2K_3 shows this is attained, so a(6) = 2.
%p A049322 := proc(n) local u; if n mod 2 = 0 then u := n/2; RETURN(u*(u-1)*(u-2)/3); elif n mod 4 = 1 then u := (n-1)/4; RETURN(u*(u-1)*(4*u+1)*2/3); else u := (n-3)/4; RETURN(u*(u+1)*(4*u-1)*2/3); fi; end;
%t Table[Binomial[n,3] - Floor[n/2*Floor[((n-1)/2)^2]],{n,0,100}] (* _Alexander Adamchuk_, Nov 29 2006 *)
%o (PARI) x='x+O('x^99); concat(vector(6), Vec(2*x^6/((x-1)^4*(x+1)^2*(x^2+1)))) \\ _Altug Alkan_, Apr 08 2016
%o (Magma) [n*(n-1)*(n-2)/6 - Floor((n/2)*Floor(((n-1)/2)^2)): n in [1..20]]; // _G. C. Greubel_, Oct 06 2017
%Y Cf. A008804.
%Y Cf. A002144, A141373, A107003, A032766, A007522, A068231, A107008.
%K nonn,nice,easy
%O 0,7
%A _Eric W. Weisstein_
%E Entry revised by _N. J. A. Sloane_, Mar 22 2004