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.

Original entry on oeis.org

0, 1, 2, 4, 7, 11, 14, 20, 25, 32, 37, 47, 52, 64, 71, 79, 88, 104, 112, 130, 140, 151, 162, 184, 193, 211, 224, 240, 253, 281, 292, 322, 338, 355, 372, 391, 404, 440, 459, 479, 494, 534, 550, 592, 612, 632, 655, 701, 718, 753, 775, 801, 824, 876
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A027430, etc.

Programs

  • Haskell
    import Data.List (nub)
    a027427 n = length $ nub [i*j | j <- [1..n], i <- [0..j-1]]
    -- Reinhard Zumkeller, Jan 01 2012
    
  • Maple
    A027427 := proc(n)
        local L, i, j ;
        L := {};
        for i from 0 to n do
            for j from i+1 to n do
                L := L union {i*j};
            end do:
        end do:
        nops(L);
    end proc:  # R. J. Mathar, Jun 09 2016
  • Mathematica
    a[n_] := Table[i*j, {i, 0, n}, {j, i+1, n}] // Flatten // Union // Length;
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Feb 03 2018 *)
  • Python
    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

Formula

a(n) = A027428(n)+1. - T. D. Noe, Jan 16 2007