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.

A039739 a(n)=2*q-prime(n), where q is the prime < p(n) for which (prime(n) mod q) is maximal.

Original entry on oeis.org

1, 1, 3, 3, 1, 5, 3, 3, 5, 3, 1, 5, 3, 11, 5, 3, 1, 7, 3, 1, 3, 3, 5, 9, 5, 3, 11, 9, 5, 7, 3, 5, 3, 9, 7, 1, 3, 11, 5, 15, 13, 3, 1, 5, 3, 3, 3, 27, 25, 21, 15, 13, 3, 5, 11, 5, 3, 1, 17, 15, 5, 7, 3, 1, 9, 3, 9, 11, 9, 5, 3, 15, 9, 3, 3, 5, 1, 21, 13, 3, 1
Offset: 2

Views

Author

Keywords

Programs

  • Maple
    A039739 := proc(n)
        local p,maxmod,q,qpiv ;
        p := ithprime(n) ;
        for j from 1 to n-1 do
            q := ithprime(j) ;
            if j = 1 then
                qpiv := q ;
                maxmod := modp(p,q) ;
            else
                if modp(p,q) > maxmod then
                    maxmod := modp(p,q) ;
                    qpiv := q ;
                end if;
            end if;
        end do:
        2*qpiv-p ;
    end proc:
    seq(A039739(n),n=2..80) ; # R. J. Mathar, May 03 2021

Formula

a(n) = 2*A039734(n)-prime(n). - R. J. Mathar, May 03 2021