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.

Showing 1-3 of 3 results.

A027384 Number of distinct products i*j with 0 <= i, j <= n.

Original entry on oeis.org

1, 2, 4, 7, 10, 15, 19, 26, 31, 37, 43, 54, 60, 73, 81, 90, 98, 115, 124, 143, 153, 165, 177, 200, 210, 226, 240, 255, 268, 297, 309, 340, 355, 373, 391, 411, 424, 461, 481, 502, 518, 559, 576, 619, 639, 660, 684, 731, 748, 779, 801, 828, 851, 904, 926, 957, 979, 1009, 1039
Offset: 0

Views

Author

Fred Schwab (fschwab(AT)nrao.edu)

Keywords

Comments

a(n) = A027420(n,0) = A027420(n,n). - Reinhard Zumkeller, May 02 2014

Crossrefs

Equals A027424 + 1, n>0.

Programs

  • Haskell
    import Data.List (nub)
    a027384 n = length $ nub [i*j | i <- [0..n], j <- [0..n]]
    -- Reinhard Zumkeller, Jan 01 2012
    
  • Maple
    A027384 := proc(n)
        local L,i,j ;
        L := {};
        for i from 0 to n do
            for j from i to n do
                L := L union {i*j};
            end do:
        end do:
        nops(L);
    end proc: # R. J. Mathar, May 06 2016
  • Mathematica
    u = {}; Table[u = Union[u, n*Range[0, n]]; Length[u], {n, 0, 100}] (* T. D. Noe, Jan 07 2012 *)
  • PARI
    a(n) = {my(s=Set()); for (i=0, n, s = setunion(s, Set(vector(n+1, k, i*(k-1))));); #s;} \\ Michel Marcus, Jan 01 2019
    
  • Python
    def A027384(n): return len({i*j for i in range(1,n+1) for j in range(1,i+1)})+1 # Chai Wah Wu, Oct 13 2023

Formula

For prime p, a(p) = a(p - 1) + p. - David A. Corneth, Jan 01 2019

A027428 Number of distinct products ij with 1 <= i < j <= n. (Number of terms appearing more than once in a 1-to-n multiplication table.)

Original entry on oeis.org

0, 1, 3, 6, 10, 13, 19, 24, 31, 36, 46, 51, 63, 70, 78, 87, 103, 111, 129, 139, 150, 161, 183, 192, 210, 223, 239, 252, 280, 291, 321, 337, 354, 371, 390, 403, 439, 458, 478, 493, 533, 549, 591, 611, 631, 654, 700, 717, 752, 774, 800, 823, 875
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (nub)
    a027428 n = length $ nub [i*j | j <- [2..n], i <- [1..j-1]]
    -- Reinhard Zumkeller, Jan 01 2012
    
  • Maple
    f:=proc(n) local i,j,t1,t2; t1:={}; for i from 1 to n-1 do for j from i+1 to n do t1:={op(t1),i*j}; od: od: t1:=convert(t1,list); nops(t1); end;
  • Mathematica
    a[n_] := Table[i*j, {i, 1, n-1}, {j, i+1, n}] // Flatten // Union // Length; Table[ a[n] , {n, 1, 53}] (* Jean-François Alcover, Jan 31 2013 *)
  • Python
    def A027428(n): return len({i*j for i in range(1,n+1) for j in range(1,i)}) # Chai Wah Wu, Oct 13 2023

Formula

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

A027429 Number of distinct products ijk with 0 <= i < j < k <= n.

Original entry on oeis.org

0, 0, 1, 2, 5, 11, 17, 30, 43, 61, 76, 112, 127, 178, 207, 239, 275, 362, 397, 508, 555, 614, 678, 839, 884, 1005, 1093, 1199, 1278, 1530, 1591, 1882, 1999, 2134, 2276, 2433, 2519, 2922, 3097, 3279, 3392, 3885, 4015, 4564, 4751, 4939, 5187, 5841, 5988, 6423
Offset: 0

Views

Author

Keywords

Examples

			a(3) = 2 (0 and 6 being the only products) and a(4) = 5 (with products 0, 6, 8, 12 and 24).
		

Crossrefs

Programs

  • Haskell
    import Data.List (nub)
    a027429 n = length $ nub [i*j*k | k<-[2..n], j<-[1..k-1], i<-[0..j-1]]
    -- Reinhard Zumkeller, Jan 01 2012
    
  • Mathematica
    nn=50; prod=Table[0, {1+nn^3}]; t=Table[Do[prod[[1+i*j*k]]=1, {i,0,n}, {j,i+1,n}, {k,j+1,n}]; Count[Take[prod,1+n^3],1], {n,0,nn}] (* T. D. Noe, Jan 16 2007 *)
  • Python
    from itertools import combinations as C
    def a(n): return len(set(i*j*k for i, j, k in C(range(n+1), 3)))
    print([a(n) for n in range(50)]) # Michael S. Branicky, May 28 2021

Formula

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

Extensions

Corrected by T. D. Noe, Jan 16 2007
Showing 1-3 of 3 results.