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-2 of 2 results.

A070735 Let r, s, t be three permutations of the set { 1, 2, 3, ..., n }; a(n) = minimal value of Sum_{i=1..n} r(i)*s(i)*t(i).

Original entry on oeis.org

1, 6, 18, 44, 89, 162, 271, 428, 642, 930, 1304, 1781, 2377, 3111, 4002, 5073, 6344, 7842, 9587, 11610, 13933, 16591, 19612, 23028, 26871, 31177, 35976, 41314, 47221, 53736, 60907, 68773, 77373, 86759, 96972, 108063, 120080, 133067, 147082, 162174, 178395, 195806, 214461, 234421, 255739
Offset: 1

Views

Author

Michael Reid (mreid(AT)math.umass.edu), May 15 2002

Keywords

Crossrefs

Cf. A000292 (for two permutations), A070736 (for four).
Cf. A072368 (three subsets of {1..3n})

Programs

  • Mathematica
    {1, 6}~Join~Table[Min[Map[Total,Map[#[[1]]*#[[2]]*#[[3]] &, Subsets[Permutations[Range[n]], {3}]]]] , {n, 3, 5}] (* Robert Price, Apr 08 2019 *)
    (* OR, if allowed to replicate small permutations to account for n=1,2 *)
    Table[ Min[Map[Total,Map[#[[1]]*#[[2]]*#[[3]] &,Subsets[If[n > 2, Permutations[Range[n]],Flatten[Table[Permutations[Range[n]], 3], 1]], {3}]]]] , {n, 1, 5}] (* Robert Price, Apr 09 2019 *)
  • PARI
    a(n) = {ret = 0; nb = n!; for (a=1, nb, pa = numtoperm(n, a); for (b=1, nb, pb = numtoperm(n, b); for (c=1, nb, pc = numtoperm(n, c); sp = sum(i=1, n, pa[i]*pb[i]*pc[i]); if (! ret, ret = sp, ret = min(ret, sp));););); return (ret);} \\ Michel Marcus, Jun 10 2013
    
  • Python
    # See Martin Fuller link, Aug 06 2023

Extensions

a(16)-a(19) from Hiroaki Yamanouchi, Aug 21 2015
a(20) onwards from Martin Fuller, Aug 06 2023

A331889 Table T(n,k) read by upward antidiagonals. T(n,k) is the minimum value of Sum_{i=1..n} Product_{j=1..k} r[(i-1)*k+j] among all permutations r of {1..kn}.

Original entry on oeis.org

1, 3, 2, 6, 10, 6, 10, 28, 54, 24, 15, 60, 214, 402, 120, 21, 110, 594, 2348, 3810, 720, 28, 182, 1334, 8556, 32808, 43776, 5040, 36, 280, 2614
Offset: 1

Views

Author

Chai Wah Wu, Mar 20 2020

Keywords

Comments

k 1 2 3 4 5 6 7 8 9 10 11 12
---------------------------------------------------------------------------------
n 1| 1 2 6 24 120 720 5040 40320 362880 3628800 39916800 479001600
2| 3 10 54 402 3810 43776
3| 6 28 214 2348 32808
4| 10 60 594 8556
5| 15 110 1334
6| 21 182 2614
7| 28 280
8| 36 408
9| 45 570
10| 55 770

Crossrefs

Programs

  • Python
    from itertools import combinations, permutations
    from sympy import factorial
    def T(n,k): # T(n,k) for A331889
        if k == 1:
            return n*(n+1)//2
        if n == 1:
            return int(factorial(k))
        if k == 2:
            return n*(n+1)*(2*n+1)//3
        nk = n*k
        nktuple = tuple(range(1,nk+1))
        nkset = set(nktuple)
        count = int(factorial(nk))
        for firsttuple in combinations(nktuple,n):
            nexttupleset = nkset-set(firsttuple)
            for s in permutations(sorted(nexttupleset),nk-2*n):
                llist = sorted(nexttupleset-set(s),reverse=True)
                t = list(firsttuple)
                for i in range(0,k-2):
                    itn = i*n
                    for j in range(n):
                            t[j] *= s[itn+j]
                t.sort()
                v = 0
                for i in range(n):
                    v += llist[i]*t[i]
                if v < count:
                    count = v
        return count

Formula

T(n,k) >= ceiling(n*((kn)!)^(1/n)).
T(n,1) = n*(n+1)/2 = A000217(n).
T(1,k) = k! = A000142(k).
T(n,3) = A072368(n).
T(n,2) = n*(n+1)*(2*n+1)/3 = A006331(n).
Showing 1-2 of 2 results.