OFFSET
1,1
COMMENTS
Probably the same sequence as: numbers n such that phi(n)+1 divides n.
Cohen and Segal showed that in case there were other solutions to this problem (which appeared to be posed by Schinzel), then they should have at least 15 distinct prime factors. Moreover, there is a connection with the Lehmer's totient problem which asks whether there is a composite n such that phi(n)|(n-1). If no such composite exists, then p and 2p are the only members for Leroy's sequence. - Francisco Salinas (franciscodesalinas(AT)hotmail.com), Apr 25 2004
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
G. L. Cohen and S. L. Segal, A note concerning those n for which phi(n)+1 divides n, Fibonacci Quarterly, Vol. 27, No. 3 (1989), pp. 285-286.
Eric Weisstein's World of Mathematics, Lehmer's Totient Problem
MATHEMATICA
With[{nn=40}, Take[Sort[Join[Prime[Range[2nn]], 2Prime[Range[2, nn]]]], 2nn]] (* Harvey P. Dale, Oct 03 2013 *)
PROG
(Python)
from sympy import primepi
def A085118(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 int(n+x-primepi(x)-primepi(x>>1)+(x>=4))
return bisection(f, n, n) # Chai Wah Wu, Oct 17 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Leroy Quet, Apr 25 2004
EXTENSIONS
More terms from David Wasserman, Jan 27 2005
STATUS
approved