OFFSET
1,2
COMMENTS
LINKS
Chai Wah Wu, Algorithms for complementary sequences, arXiv:2409.05844 [math.NT], 2024.
PROG
(Python)
from sympy import primepi, prime
def A138836(n): return n+(k:=int(primepi((n).bit_length())-1))+int(n+k+1>=1<<prime(k+1)) if n>1 else 1 # Chai Wah Wu, Sep 10 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Apr 05 2008
STATUS
approved