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.

A381083 Brent's irregular triangle T[r,k] related to Hardy-Littlewood constants of prime gaps 2r.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 1, 4, 6, 2, 30, 56, 30, 4, 18, 40, 28, 6, 15, 40, 36, 12, 1, 30, 92, 100, 44, 6, 180, 624, 812, 480, 120, 8, 150, 504, 632, 350, 72, 2970, 10880, 15642, 11008, 3780, 504, 1620, 6688, 11090, 9378, 4224, 952, 84, 1782, 7400, 12312, 10400, 4634, 1008, 80, 3960, 19312, 38958, 41768, 25376, 8570, 1446, 90, 22275, 113792, 244829, 287904, 200805, 84280, 20583, 2656, 140, 23760, 122400, 265734, 315120, 220944, 92466, 22120, 2700, 128
Offset: 1

Views

Author

R. J. Mathar, Feb 13 2025

Keywords

Examples

			Triangle starts
1
1 ;
2 2 ;
3 4 1 ;
4 6 2 ;
30 56 30 4 ;
18 40 28 6 ;
15 40 36 12 1 ;
30 92 100 44 6 ;
180 624 812 480 120 8 ;
150 504 632 350 72 ;
2970 10880 15642 11008 3780 504 ;
1620 6688 11090 9378 4224 952 84 ;
1782 7400 12312 10400 4634 1008 80 ;
3960 19312 38958 41768 25376 8570 1446 90 ;
22275 113792 244829 287904 200805 84280 20583 2656 140 ;
23760 122400 265734 315120 220944 92466 22120 2700 128 ;
		

Crossrefs

Columns: A381084 (k=1), A381085 (k=2), A381086 (k=3).

Programs

  • Maple
    # Generate a list of lists where each
    # sublist has k distinct elements, all elements are larger than kmin,
    # all elements smaller than r. Number of sublists is the
    # usual binomial(r-kmin,k).
    seleLrec := proc(k,r,kmin)
        local Lout,ki,Lloc,subl ;
        Lout := [] ;
        # no solutions if kmin+k is too large compared with r
        if kmin+k <= r and k > 0 then
            for ki from kmin to r-k do
                # recurse assuming that ki is heading new sublists
                if k = 1 then
                    Lout := [op(Lout),[ki]] ;
                else
                    Lloc := procname(k-1,r,ki+1) ;
                    for subl in Lloc do
                        #prepend ki
                        Lout := [op(Lout),[ki,op(subl)]] ;
                    end do:
                end if;
            end do:
        end if;
        Lout ;
    end proc:
    # generate a list of lists where each
    # list starts with 0 and has k-1 more elements
    # (distinct, sorted) all < r.
    seleL := proc(k,r)
        local Lout,subl ;
        Lout := [] ;
        subl := seleLrec(k-1,r,1) ;
        if k = 1 then
            Lout := [[0]] ;
        else
            for L in subl do
                # prepend 0
                [0,op(L)] ;
                Lout := [op(Lout),%] ;
            end do:
        end if;
        Lout ;
    end proc:
    # @param L list of distinct nonneg. integers
    # @param r a number larger than all elements in L
    # @param q odd prime
    # @return The number of distinct residues of 0, L[1], L[2],...,r modulo p
    wr := proc(L::list,r::integer,q::integer)
        local mset,m ;
        mset := {0} ;
        for m in L do
            mset := mset union { modp(m,q) } ;
        end do:
        mset := mset union { modp(r,q) } ;
        nops(mset) ;
    end proc:
    # Brent Math Comp 28 (125) (1973) p 316 eq (10) sum over all m-tuples and products over q
    T := proc(r,k)
        local a,mL,qprod,i,q ;
        a := 0 ;
        # k-1 numbers m0=0 r+1 then
                    break ;
                end if;
                qprod := qprod*(q-wr(mL,r,q)) ;
            end do:
            a := a+qprod ;
        end do:
        a ;
    end proc:
    # short table of first 12 rows
    for r from 1 to 12 do
        for k from 1  to r do
            printf("%d ",T(r,k)) ;
        end do:
        printf("\n") ;
    end do: