OFFSET
1,1
COMMENTS
Terms are primes of the form 1 + A045699(n) for some n.
The first term that can be expressed two distinct ways is a(207) = 159079 = 101^2+53^3+1 = 367^2+29^3+1.
There are 27 values < 10^8 that can be expressed in two distinct ways.
LINKS
Christian N. K. Anderson, Table of n, a(n) for n = 1..10000
EXAMPLE
53 is in the sequence because 53 = 5^2 + 3^3 + 1 and 3, 5, and 53 are all prime numbers.
PROG
(PARI)
isa(n) = {
my(r);
forprime(x = 1, sqrtint(n),
r = n - x ^ 2 - 1;
if( ispower(r, 3, &p) && isprime(p),
return(1)
)
);
return(0)
}
select(isa, primes(1200))
(Python)
from sympy import isprime, primerange
def aupto(lim):
sq = list(p**2 for p in primerange(1, int(lim**(1/2))+2))
cb = list(p**3 for p in primerange(1, int(lim**(1/3))+2))
s3 = set(s for s in (a + b + 1 for a in sq for b in cb) if s <= lim)
return list(filter(isprime, sorted(s3)))
print(aupto(9999)) # Michael S. Branicky, Jun 24 2021
(SageMath)
def aList(sup):
P = [p**2 for p in prime_range(1, int(sup**(1/2))+2)]
Q = [(p**3 + 1) for p in prime_range(1, int(sup**(1/3))+2)]
return sorted([a+b for a in P for b in Q if a+b <= sup and is_prime(a+b)])
print(aList(9999)) # Peter Luschny, Jun 25 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Kevin L. Schwartz and Christian N. K. Anderson, Mar 22 2013
STATUS
approved