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.

A062857 Size of smallest square multiplication table which contains some number at least n times.

This page as a plain text file.
%I A062857 #18 Oct 16 2023 23:29:53
%S A062857 1,2,4,6,12,12,18,20,30,30,40,40,60,60,72,72,90,90,120,120,140,140,
%T A062857 168,168,180,180,210,210,252,252,280,280,315,315,336,336,360,360,420,
%U A062857 420,504,504,560,560,630,630,672,672,720,720,792,792,840,840,924,924,990
%N A062857 Size of smallest square multiplication table which contains some number at least n times.
%C A062857 a(n) is the least number m such that there exists k with 1 <= k <= m^2 such that k has at least n divisors t with k/m <= t <= m. - _Robert Israel_, Jan 30 2017
%e A062857 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).
%t A062857 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]]];
%t A062857 Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Mar 25 2019 *)
%o A062857 (MATLAB)
%o A062857 N = 1000; % to get all terms with a(n) <= N
%o A062857 M = sparse(1,N^2);
%o A062857 A(1) = 1;
%o A062857 imax = 1;
%o A062857 for k = 2:N
%o A062857   M(k*[1:k-1]) = M(k*[1:k-1])+2;
%o A062857   M(k^2) = 1;
%o A062857   newimax = max(M);
%o A062857   A(imax+1:newimax) = k;
%o A062857   imax = newimax;
%o A062857 end
%o A062857 A  % _Robert Israel_, Jan 30 2017
%o A062857 (Python)
%o A062857 from itertools import count
%o A062857 from collections import Counter
%o A062857 def A062857(n):
%o A062857     if n == 1: return 1
%o A062857     c = Counter()
%o A062857     for m in count(1):
%o A062857         for i in range(1,m):
%o A062857             ij = i*m
%o A062857             c[ij] += 2
%o A062857             if c[ij]>=n:
%o A062857                 return m
%o A062857         c[m*m] = 1 # _Chai Wah Wu_, Oct 16 2023
%Y A062857 The least such number is A062856(n).
%Y A062857 Cf. A027424, A062851, A062854, A062855, A062856, A062858, A062859.
%K A062857 nonn
%O A062857 1,2
%A A062857 Ron Lalonde (ronronronlalonde(AT)hotmail.com), Jun 25 2001
%E A062857 More terms from _Don Reble_, Nov 08 2001
%E A062857 Name clarified by _Robert Israel_, Jan 30 2017