login
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.
2
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,3
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.
LINKS
Étienne Fouvry, Claude Levesque, Michel Waldschmidt, Representation of integers by cyclotomic binary forms, arXiv:1712.09019 [math.NT], 2017.
EXAMPLE
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).
PROG
(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))
CROSSREFS
Sequence in context: A282516 A158092 A145264 * A357019 A352562 A362326
KEYWORD
nonn
AUTHOR
Peter Luschny, Mar 03 2018
STATUS
approved