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.

A027427 Number of distinct products ij with 0 <= i < j <= n.

This page as a plain text file.
%I A027427 #27 Jul 08 2025 17:52:21
%S A027427 0,1,2,4,7,11,14,20,25,32,37,47,52,64,71,79,88,104,112,130,140,151,
%T A027427 162,184,193,211,224,240,253,281,292,322,338,355,372,391,404,440,459,
%U A027427 479,494,534,550,592,612,632,655,701,718,753,775,801,824,876
%N A027427 Number of distinct products ij with 0 <= i < j <= n.
%H A027427 T. D. Noe, <a href="/A027427/b027427.txt">Table of n, a(n) for n = 0..1000</a>
%F A027427 a(n) = A027428(n)+1. - _T. D. Noe_, Jan 16 2007
%p A027427 A027427 := proc(n)
%p A027427     local L, i, j ;
%p A027427     L := {};
%p A027427     for i from 0 to n do
%p A027427         for j from i+1 to n do
%p A027427             L := L union {i*j};
%p A027427         end do:
%p A027427     end do:
%p A027427     nops(L);
%p A027427 end proc:  # _R. J. Mathar_, Jun 09 2016
%t A027427 a[n_] := Table[i*j, {i, 0, n}, {j, i+1, n}] // Flatten // Union // Length;
%t A027427 Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Feb 03 2018 *)
%o A027427 (Haskell)
%o A027427 import Data.List (nub)
%o A027427 a027427 n = length $ nub [i*j | j <- [1..n], i <- [0..j-1]]
%o A027427 -- _Reinhard Zumkeller_, Jan 01 2012
%o A027427 (Python)
%o A027427 def A027427(n): return 1+len({i*j for i in range(1,n+1) for j in range(1,i)}) if n else 0 # _Chai Wah Wu_, Oct 13 2023
%Y A027427 Cf. A027430, etc.
%Y A027427 Cf. A027384, A027428, A027429.
%K A027427 nonn
%O A027427 0,3
%A A027427 _N. J. A. Sloane_