%I #34 Mar 06 2018 03:31:29
%S 3,4,7,12,13,19,21,27,28,31,37,39,43,48,49,52,57,61,63,67,73,75,76,79,
%T 80,84,91,93,97,103,108,109,111,112,117,121,124,127,129,133,139,147,
%U 148,151,156,157,163,169,171,172,175,181,183,189,192,193,196,199
%N Integers of the form Sum_{j in 0:p-1} x^j*y^(p-j-1) where x and y are positive integers with max(x, y) >= 2 and p is some prime.
%C Equivalently these are the integers represented by a cyclotomic binary form Phi_p(x,y) where p is prime and x and y are positive integers with max(x,y) >= 2. A cyclotomic binary form (over Z) is a homogeneous polynomial in two variables of the form f(x, y) = y^phi(k)*Phi(k, x/y) where Phi(k, z) is a cyclotomic polynomial of index k and phi is Euler's totient function.
%C An efficient and safe calculation of this sequence requires a precise knowledge of the range of possible solutions of the associated Diophantine equations. The bounds used in the Julia program below were specified by Fouvry, Levesque and Waldschmidt.
%H Peter Luschny, <a href="/A300332/b300332.txt">Table of n, a(n) for n = 1..10000</a>
%H Étienne Fouvry, Claude Levesque, Michel Waldschmidt, <a href="https://arxiv.org/abs/1712.09019">Representation of integers by cyclotomic binary forms</a>, arXiv:1712.09019 [math.NT], 2017.
%e Let p denote an odd prime. Subsequences are numbers of the form
%e 2^p - 1, (A001348) (x = 1, y = 2) (Mersenne numbers),
%e p*2^(p - 1), (A299795) (x = 2, y = 2),
%e (3^p - 1)/2, (A003462) (x = 1, y = 3),
%e 3^p - 2^p, (A135171) (x = 2, y = 3),
%e p*3^(p - 1), (A027471) (x = 3, y = 3),
%e (4^p - 1)/3, (A002450) (x = 1, y = 4),
%e 2^(p-1)*(2^p-1), (A006516) (x = 2, y = 4),
%e 4^p - 3^p, (A005061) (x = 3, y = 4),
%e p*4^(p - 1), (A002697) (x = 4, y = 4),
%e (p^p-1)/(p-1), (A023037),
%e p^p, (A000312, A051674).
%e .
%e The generalized cuban primes A007645 are a subsequence, as are the quintan primes A002649, the septan primes and so on.
%e All primes in this sequence less than 1031 are generalized cuban primes. 1031 is an element because 1031 = f(5,2) where f(x,y) = x^4 + y*x^3 + y^2*x^2 + y^3*x + y^4, however 1031 is not a cuban prime because 1030 is not divisible by 6.
%o (Julia)
%o using Primes
%o function isA300332(n)
%o logn = log(n)^1.161
%o K = Int(floor(5.383*logn))
%o M = Int(floor(2*(n/3)^(1/2)))
%o k = 2
%o while k <= K
%o if k == 7
%o K = Int(floor(4.864*logn))
%o M = Int(ceil(2*(n/11)^(1/4)))
%o end
%o for y in 2:M, x in 1:y
%o r = x == y ? k*y^(k - 1) : div(x^k - y^k, x - y)
%o n == r && return true
%o end
%o k = nextprime(k+1)
%o end
%o return false
%o end
%o A300332list(upto) = [n for n in 1:upto if isA300332(n)]
%o println(A300332list(200))
%Y Indices of the nonzero values of A300333.
%Y Cf. A001348, A299795, A003462, A135171, A027471, A002450, A006516, A005061, A002697, A000312, A051674, A023037, A007645.
%K nonn
%O 1,1
%A _Peter Luschny_, Mar 03 2018