proposed
approved
Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
proposed
approved
editing
proposed
return next(filter(lambda m:isprime(1-m**k+m**(k<<1)), count(2))) # Chai Wah Wu, Oct 22 2024
(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
approved
editing
proposed
approved
editing
proposed
a(n) = A085396is smallest positive m such that Phi(A033845(n),m) is prime. - Chai Wah Wu, Sep 16 2024
proposed
editing
editing
proposed
reviewed
approved