login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A027426 Number of distinct products ijk with 0 <= i,j,k <= n. 6

%I #29 May 28 2021 23:03:20

%S 1,2,5,11,17,31,41,66,81,101,121,174,195,267,302,344,379,493,537,679,

%T 733,805,877,1076,1131,1248,1344,1451,1538,1834,1910,2249,2363,2516,

%U 2669,2851,2941,3401,3588,3790,3920,4478,4625,5243,5441,5655,5917,6647,6799,7197

%N Number of distinct products ijk with 0 <= i,j,k <= n.

%H Alois P. Heinz, <a href="/A027426/b027426.txt">Table of n, a(n) for n = 0..1000</a> (first 201 terms from T. D. Noe)

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

%p a:=proc(n): nops({seq(seq(seq(i*j*k,k=0..j),j=0..i),i=0..n)}) end: seq(a(n),n=0..50); # _Emeric Deutsch_, Jan 25 2007

%t a[n_] := Table[i*j*k, {i, 0, n}, {j, i, n}, {k, j, n}] // Flatten // Union // Length; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Jan 30 2018 *)

%o (Haskell)

%o import Data.List (nub)

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

%o -- _Reinhard Zumkeller_, Jan 01 2012

%o (PARI) pr(n)=my(v=List());for(i=1,n, for(j=i,n, listput(v, i*j))); Set(v)

%o a(n)=my(v=pr(n),u=v); for(i=2,n,u=Set(concat(u,v*i))); #u+1 \\ _Charles R Greathouse IV_, Mar 04 2014

%o (Python)

%o from itertools import combinations_with_replacement as mc

%o def a(n): return len(set(i*j*k for i, j, k in mc(range(n+1), 3)))

%o print([a(n) for n in range(50)]) # _Michael S. Branicky_, May 28 2021

%Y Cf. A027384, A027429.

%K nonn

%O 0,2

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)