%I #38 Oct 18 2024 01:43:45
%S 2,3,5,6,7,10,11,13,14,17,19,22,23,26,29,31,34,37,38,41,43,46,47,53,
%T 58,59,61,62,67,71,73,74,79,82,83,86,89,94,97,101,103,106,107,109,113,
%U 118,122,127,131,134,137,139,142,146,149,151,157,158,163,166,167,173,178
%N Primes together with twice the odd primes.
%C Probably the same sequence as: numbers n such that phi(n)+1 divides n.
%C 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
%H Vincenzo Librandi, <a href="/A085118/b085118.txt">Table of n, a(n) for n = 1..1000</a>
%H G. L. Cohen and S. L. Segal, <a href="http://www.fq.math.ca/Scanned/27-3/cohen.pdf">A note concerning those n for which phi(n)+1 divides n</a>, Fibonacci Quarterly, Vol. 27, No. 3 (1989), pp. 285-286.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LehmersTotientProblem.html">Lehmer's Totient Problem</a>
%t With[{nn=40},Take[Sort[Join[Prime[Range[2nn]],2Prime[Range[2,nn]]]],2nn]] (* _Harvey P. Dale_, Oct 03 2013 *)
%o (Python)
%o from sympy import primepi
%o def A085118(n):
%o def bisection(f,kmin=0,kmax=1):
%o while f(kmax) > kmax: kmax <<= 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return kmax
%o def f(x): return int(n+x-primepi(x)-primepi(x>>1)+(x>=4))
%o return bisection(f,n,n) # _Chai Wah Wu_, Oct 17 2024
%Y Cf. A000010, A068422.
%Y Equals A001751\{4}.
%K nonn,easy
%O 1,1
%A _Leroy Quet_, Apr 25 2004
%E More terms from _David Wasserman_, Jan 27 2005