OFFSET
1,1
COMMENTS
1 - m^k + m^(2*k) equals Phi(6*k,m) when k=2^p*3^q, p>=0, q>=0, which may be prime numbers for certain positive integer m>1.
The Mathematica program given here generates the first 33 terms. Further terms were generated by OpenPFGW.
a(62)=7426, while A003586(62)=3^8=6561.
FORMULA
a(n) is smallest positive m such that Phi(A033845(n),m) is prime. - Chai Wah Wu, Sep 16 2024
EXAMPLE
MATHEMATICA
fQ[n_] := n == 3 EulerPhi@n; a = Select[6 Range@500, fQ]/6; l =
Length[a]; Table[m = a[[j]]; i = 1;
While[i++; cp = 1 - i^m + i^(2*m); ! PrimeQ[cp]]; i, {j, 1, l}]
PROG
(Python)
from itertools import count
from sympy import isprime, integer_log
def A205506(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x): return n+x-sum((x//3**i).bit_length() for i in range(integer_log(x, 3)[0]+1))
k = bisection(f, n, n)
return next(filter(lambda m:isprime(1-m**k+m**(k<<1)), count(2))) # Chai Wah Wu, Oct 22 2024
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
Lei Zhou, Feb 01 2012
STATUS
approved