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.

A228650 Numbers k such that if an urn contains k balls, with at least one each of three colors, there exists a combination of the three colors such that it is equally probable for three balls randomly selected from the urn to all be either the same color or distinct colors.

This page as a plain text file.
%I A228650 #17 Jul 30 2022 08:19:14
%S A228650 6,8,11,12,46,57,66,120,121,145,156,162,166,217,372,386,557,596,638,
%T A228650 750,866,1025,1038,1201,1396,1857,2042,2081,2146,2263,2301,2452,2836,
%U A228650 2900,2926,2991,3026,3053,3288,3368,3963,3970,4511,4656,5006,5492,5890,5952
%N A228650 Numbers k such that if an urn contains k balls, with at least one each of three colors, there exists a combination of the three colors such that it is equally probable for three balls randomly selected from the urn to all be either the same color or distinct colors.
%C A228650 If the urn contains 596 balls, there exist two inequivalent combinations with the desired property, {86, 246, 264} and {126, 154, 316}.
%C A228650 The analogous sequence for two colors are the square numbers > 1 (A000290 with first two terms truncated).
%e A228650 46 is a member of the sequence because if the urn contains 6 red, 18 green and 22 blue balls, then there are 6 * 18 * 22 = 2376 selections of three balls with distinct colors, and ((6 * 5 * 4) + (18 * 17 * 16) + (22 * 21 * 20)) / 3! = 2376 selections of three balls all the same color, and 6 + 18 + 22 = 46.
%o A228650 (Pascal) program a228650;
%o A228650 var
%o A228650   p: array[1..6000] of int64;
%o A228650   b1, b2, b3, k: int64;
%o A228650   n, s: integer;
%o A228650 begin
%o A228650   k:=0;
%o A228650   repeat
%o A228650     inc(k);
%o A228650     p[k] := (k * (k - 1) * (k - 2)) div 6;
%o A228650   until k = 6000;
%o A228650   n := 0; k := 2;
%o A228650   repeat
%o A228650     inc(k); s := 0;
%o A228650     b1 := 0;
%o A228650     repeat
%o A228650       inc(b1);
%o A228650       b2 := b1 - 1;
%o A228650         b3 := k - (b1 + b2);
%o A228650         repeat
%o A228650         inc(b2); dec(b3);
%o A228650         if (b3 >= b2) and (b1 * b2 * b3 = p[b1] + p[b2] + p[b3]) then
%o A228650         begin
%o A228650           inc(n); inc(s);
%o A228650           writeln(n,' ',k);
%o A228650         end;
%o A228650       until (b3 <= b2) or (s > 0);
%o A228650     until (3 * b1 >= k) or (s > 0);
%o A228650   until k = 6000;
%o A228650 end.
%Y A228650 Cf. A228651, A228652, A228653.
%K A228650 nonn
%O A228650 1,1
%A A228650 _William Rex Marshall_, Aug 29 2013