This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A001751 #40 Oct 17 2024 12:52:16 %S A001751 2,3,4,5,6,7,10,11,13,14,17,19,22,23,26,29,31,34,37,38,41,43,46,47,53, %T A001751 58,59,61,62,67,71,73,74,79,82,83,86,89,94,97,101,103,106,107,109,113, %U A001751 118,122,127,131,134,137,139,142,146,149,151,157,158,163,166 %N A001751 Primes together with primes multiplied by 2. %C A001751 For n > 1, a(n) is position of primes in A026741. %C A001751 For n > 1, a(n) is the position of the ones in A046079. - _Ant King_, Jan 29 2011 %C A001751 A251561(a(n)) != a(n). - _Reinhard Zumkeller_, Dec 27 2014 %C A001751 Number of terms <= n is pi(n) + pi(n/2). - _Robert G. Wilson v_, Aug 04 2017 %C A001751 Number of terms <=10^k: 7, 40, 263, 1898, 14725, 120036, 1013092, 8762589, 77203401, 690006734, 6237709391, 56916048160, 523357198488, 4843865515369, ..., . - _Robert G. Wilson v_, Aug 04 2017 %C A001751 Complement of A264828. - _Chai Wah Wu_, Oct 17 2024 %H A001751 T. D. Noe, <a href="/A001751/b001751.txt">Table of n, a(n) for n = 1..10000</a> %t A001751 Select[Range[163], Or[PrimeQ[#], PrimeQ[1/2 #]] &] (* _Ant King_, Jan 29 2011 *) %t A001751 upto=200;With[{pr=Prime[Range[PrimePi[upto]]]},Select[Sort[Join[pr,2pr]],# <= upto&]] (* _Harvey P. Dale_, Sep 23 2014 *) %o A001751 (Haskell) %o A001751 a001751 n = a001751_list !! (n-1) %o A001751 a001751_list = 2 : filter (\n -> (a010051 $ div n $ gcd 2 n) == 1) [1..] %o A001751 -- _Reinhard Zumkeller_, Jun 20 2011 (corrected, improved), Dec 17 2010 %o A001751 (PARI) isA001751(n)=isprime(n/gcd(n,2)) || n==2 %o A001751 (PARI) list(lim)=vecsort(concat(primes(primepi(lim)), 2* primes(primepi(lim\2)))) \\ _Charles R Greathouse IV_, Oct 31 2012 %o A001751 (Python) %o A001751 from sympy import primepi %o A001751 def A001751(n): %o A001751 def bisection(f,kmin=0,kmax=1): %o A001751 while f(kmax) > kmax: kmax <<= 1 %o A001751 while kmax-kmin > 1: %o A001751 kmid = kmax+kmin>>1 %o A001751 if f(kmid) <= kmid: %o A001751 kmax = kmid %o A001751 else: %o A001751 kmin = kmid %o A001751 return kmax %o A001751 def f(x): return int(n+x-primepi(x)-primepi(x>>1)) %o A001751 return bisection(f,n,n) # _Chai Wah Wu_, Oct 17 2024 %Y A001751 Union of A001747 and A000040. %Y A001751 Subsequence of A039698 and of A033948. %Y A001751 Cf. A026741, A046079, A178156, A251561, A264828. %K A001751 nonn,easy %O A001751 1,1 %A A001751 _N. J. A. Sloane_