%I #135 Aug 17 2024 22:52:56
%S 2,3,4,6,7,9,10,12,15,16,19,21,22,24,27,30,31,34,36,37,40,42,45,49,51,
%T 52,54,55,57,64,66,69,70,75,76,79,82,84,87,90,91,96,97,99,100,106,112,
%U 114,115,117,120,121,126,129,132,135,136,139,141,142,147,154,156,157
%N Numbers k such that 2k-1 is prime.
%C a(n) is the inverse of 2 modulo prime(n) for n >= 2. - _Jean-François Alcover_, May 02 2017
%C The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - _Jeremy Gardiner_, Sep 10 2004
%C Positions of prime numbers among odd numbers. - _Zak Seidov_, Mar 26 2013
%C Also, the integers remaining after removing every third integer following 2, and, recursively, removing every p-th integer following the next remaining entry (where p runs through the primes, beginning with 5). - _Pete Klimek_, Feb 10 2014
%C Also, numbers k such that k^2 = m^2 + p, for some integers m and every prime p > 2. Applicable m values are m = k - 1 (giving p = 2k - 1). Less obvious is: no solution exists if m equals any value in A047845, which is the complement of (A006254 - 1). - _Richard R. Forberg_, Apr 26 2014
%C If you define a different type of multiplication (*) where x (*) y = x * y + (x - 1) * (y - 1), (which has the commutative property) then this is the set of primes that follows. - _Jason Atwood_, Jun 16 2019
%H T. D. Noe, <a href="/A006254/b006254.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = (A000040(n+1) + 1)/2 = A067076(n-1) + 2 = A086801(n-1)/2 + 2.
%F a(n) = (1 + A065091(n))/2. - _Omar E. Pol_, Nov 10 2007
%F a(n) = sqrt((A065091^2 + 2*A065091+1)/4). - _Eric Desbiaux_, Jun 29 2009
%F a(n) = A111333(n+1). - _Jonathan Sondow_, Jan 20 2016
%t Rest@Prime@Range@70/2 + 1/2 (* _Robert G. Wilson v_, Jun 16 2006 *)
%t Select[Range[200], PrimeQ[2#-1]&] (* _Harvey P. Dale_, Apr 06 2014 *)
%o (Magma) [n: n in [0..1000] | IsPrime(2*n-1)]; // _Vincenzo Librandi_, Nov 18 2010
%o (PARI) a(n)=prime(n+1)\2+1 \\ _Charles R Greathouse IV_, Mar 20 2013
%o (Python)
%o from sympy import prime
%o def A006254(n): return prime(n+1)+1>>1 # _Chai Wah Wu_, Aug 02 2024
%Y Cf. A000040, A067076, A086801.
%Y Equals A005097 + 1. A130291 is an essentially identical sequence.
%Y Cf. A065091.
%Y Numbers n such that 2n+k is prime: A005097 (k=1), A067076 (k=3), A089038 (k=5), A105760 (k=7), A155722 (k=9), A101448 (k=11), A153081 (k=13), A089559 (k=15), A173059 (k=17), A153143 (k=19).
%Y Numbers n such that 2n-k is prime: this seq(k=1), A098090 (k=3), A089253 (k=5), A089192 (k=7), A097069 (k=9), A097338 (k=11), A097363 (k=13), A097480 (k=15), A098605 (k=17), A097932 (k=19).
%K nonn,easy
%O 1,1
%A _Marc LeBrun_
%E More terms from _Erich Friedman_
%E More terms from _Omar E. Pol_, Nov 10 2007