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.

A300333 a(n) = max{ p prime | n = Sum_{j in 0:p-1} x^j*y^(p-j-1)} where x and y are positive integers with max(x, y) >= 2 or 0 if no such representation exists.

Original entry on oeis.org

0, 0, 2, 2, 0, 0, 3, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 5, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 3, 3, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 3, 3, 0, 0, 3, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 3, 0, 3, 3, 0, 0, 0, 0, 3, 0, 0, 0, 5
Offset: 1

Views

Author

Peter Luschny, Mar 03 2018

Keywords

Comments

All prime numbers appear as values. The earliest appearance of the prime p has the index 2^p - 1 (Mersenne number).
The indices of the nonzero values are in A300332.

Examples

			Let f(x,y) = y^2 + x*y + x^2, g(x,y) = y^6 + x*y^5 + x^2*y^4 + x^3*y^3 + x^4*y^2 + x^5*y + x^6 and h(x,y) = Sum_{j in 0:10} x^j*y^(10-j). Then
a(49) = 3 because 49 = f(5, 3).
a(217) = 3 because 217 = f(13, 3).
a(448) = 7 because 448 = g(2, 2).
a(2047) = 11 because 2047 = h(2, 1).
		

Crossrefs

Programs

  • Julia
    using Primes, Nemo
    function A300333(n)
        R, z = PolynomialRing(ZZ, "z")
        N = QQ(n)
        # Bounds from Fouvry & Levesque & Waldschmidt
        logn = log(n)^1.161
        K = Int(floor(5.383*logn))
        M = Int(floor(2*(n/3)^(1/2)))
        k, p = 2, 0
        while k <= K
            if k == 7
                K = Int(ceil(4.864*logn))
                M = Int(ceil(2*(n/11)^(1/4)))
            end
            e = Int(eulerphi(ZZ(k)))
            c = cyclotomic(k, z)
            for y in 2:M, x in 1:y
                N == y^e*subst(c, QQ(x,y)) &&  (p = k)
            end
            k = nextprime(k+1)
        end
        return p
    end
    A300333list(upto) = [A300333(n) for n in 1:upto]
    println(A300333list(121))