OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000 (first 201 terms from T. D. Noe)
MAPLE
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
MATHEMATICA
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 *)
PROG
(Haskell)
import Data.List (nub)
a027426 n = length $ nub [i*j*k | i <- [0..n], j <- [0..n], k <- [0..n]]
-- Reinhard Zumkeller, Jan 01 2012
(PARI) pr(n)=my(v=List()); for(i=1, n, for(j=i, n, listput(v, i*j))); Set(v)
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
(Python)
from itertools import combinations_with_replacement as mc
def a(n): return len(set(i*j*k for i, j, k in mc(range(n+1), 3)))
print([a(n) for n in range(50)]) # Michael S. Branicky, May 28 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved