login

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”).

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

%I #25 Oct 13 2023 18:52:54

%S 0,1,2,4,7,11,14,20,25,32,37,47,52,64,71,79,88,104,112,130,140,151,

%T 162,184,193,211,224,240,253,281,292,322,338,355,372,391,404,440,459,

%U 479,494,534,550,592,612,632,655,701,718,753,775,801,824,876

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

%H T. D. Noe, <a href="/A027427/b027427.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = A027428(n)+1. - _T. D. Noe_, Jan 16 2007

%p A027427 := proc(n)

%p local L, i, j ;

%p L := {};

%p for i from 0 to n do

%p for j from i+1 to n do

%p L := L union {i*j};

%p end do:

%p end do:

%p nops(L);

%p end proc: # _R. J. Mathar_, Jun 09 2016

%t a[n_] := Table[i*j, {i, 0, n}, {j, i+1, n}] // Flatten // Union // Length;

%t Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Feb 03 2018 *)

%o (Haskell)

%o import Data.List (nub)

%o a027427 n = length $ nub [i*j | j <- [1..n], i <- [0..j-1]]

%o -- _Reinhard Zumkeller_, Jan 01 2012

%o (Python)

%o 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 Cf. A027430, etc.

%Y Cf. A027384, A027428, A027429.

%K nonn

%O 0,3

%A _N. J. A. Sloane_.