Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #28 Jun 02 2022 10:26:18
%S 1,2,6,12,12,12,12,24,72,60,60,72,72,72,120,240,240,180,180,360,360,
%T 360,360,720,720,720,720,720,720,720,720,720,720,720,840,2520,2520,
%U 2520,2520,1440,1440,2520,2520,2520,2520,2520,2520,5040,5040,5040,5040
%N Smallest of the most frequently occurring numbers in 1-to-n multiplication cube.
%H Branden Aldridge and David A. Corneth, <a href="/A057340/b057340.txt">Table of n, a(n) for n = 1..10000</a> (first 500 terms from Branden Aldridge)
%e M(n) is the array in which m(x,y,z)=x*y*z for x = 1 to n, y = 1 to n and z = 1 to n. In M(7), the most frequently occurring numbers are 12 and 24, each occurring 15 times. The smallest of these numbers is 12, so a(7) = 12.
%o (Java)
%o public class SmallestMultCube {
%o static int low, highestFrequency = 0;
%o static int[] counters;
%o public static void main(String[] args) {
%o int max=500;
%o counters = new int[max*max*max+1];
%o for(int outer=1; outer<=max; outer++) {
%o tally(outer*outer*outer, 1);
%o for(int middle=outer-1; middle>=1; middle--) {
%o tally(outer*outer*middle, 3); tally(outer*middle*middle, 3);
%o for(int inner=middle-1; inner>=1; inner--) {
%o tally(outer*middle*inner, 6); } }
%o System.out.println(outer+" "+low); } }
%o private static void tally(int number, int repeatFactor) {
%o counters[number] += repeatFactor;
%o if(counters[number] >= highestFrequency) {
%o if (counters[number] == highestFrequency)
%o if (number < low) low = number;
%o if (counters[number] > highestFrequency) {
%o highestFrequency = counters[number]; low = number; } } } }
%o // _Branden Aldridge_, Apr 15 2022
%Y Cf. A025487, A057144, A057338, A057343, A057346.
%K nonn
%O 1,2
%A _Neil Fernandez_, Aug 28 2000
%E More terms from _David W. Wilson_, Aug 28 2001