A062857 Size of smallest square multiplication table which contains some number at least n times.
1, 2, 4, 6, 12, 12, 18, 20, 30, 30, 40, 40, 60, 60, 72, 72, 90, 90, 120, 120, 140, 140, 168, 168, 180, 180, 210, 210, 252, 252, 280, 280, 315, 315, 336, 336, 360, 360, 420, 420, 504, 504, 560, 560, 630, 630, 672, 672, 720, 720, 792, 792, 840, 840, 924, 924, 990
Offset: 1
Keywords
Examples
a(7)=18 because the 18 X 18 multiplication table is the smallest to contain a product of frequency 7 (namely the number A062856(7)=36).
Crossrefs
Programs
-
MATLAB
N = 1000; % to get all terms with a(n) <= N M = sparse(1,N^2); A(1) = 1; imax = 1; for k = 2:N M(k*[1:k-1]) = M(k*[1:k-1])+2; M(k^2) = 1; newimax = max(M); A(imax+1:newimax) = k; imax = newimax; end A % Robert Israel, Jan 30 2017
-
Mathematica
a[1] = 1; a[n_] := a[n] = For[m = a[n-1], True, m++, T = Table[i j, {i, m}, {j, m}] // Flatten // Tally; sel = SelectFirst[T, #[[2]] >= n&]; If[sel != {}, Print[n, " ", m, " ", sel[[1]]]; Return[m]]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Mar 25 2019 *)
-
Python
from itertools import count from collections import Counter def A062857(n): if n == 1: return 1 c = Counter() for m in count(1): for i in range(1,m): ij = i*m c[ij] += 2 if c[ij]>=n: return m c[m*m] = 1 # Chai Wah Wu, Oct 16 2023
Extensions
More terms from Don Reble, Nov 08 2001
Name clarified by Robert Israel, Jan 30 2017
Comments