login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A172054 n-th number k such that 6*k-1 is composite while 6*k+1 is prime minus n-th number m such that 6*m-1 is prime while 6*m+1 is composite. 2

%I #27 Sep 08 2022 08:45:50

%S 2,3,4,2,6,7,5,7,8,7,9,12,12,12,9,4,6,4,8,9,7,8,12,11,14,17,17,12,18,

%T 17,19,13,13,10,11,9,8,7,15,17,18,13,12,13,13,11,11,15,19,19,23,23,19,

%U 12,16,17,12,11,18,22,27,29,27,27,25,18,27,28,23,22,23,17,21,24,23,23,30

%N n-th number k such that 6*k-1 is composite while 6*k+1 is prime minus n-th number m such that 6*m-1 is prime while 6*m+1 is composite.

%C Are there negative terms?

%C The entries are positive for at least the first 250000 terms. - _R. J. Mathar_, May 22 2010

%H Muniru A Asiru, <a href="/A172054/b172054.txt">Table of n, a(n) for n = 1..20000</a>

%F a(n) = A121765(n) - A121763(n).

%e The number 6 is the first integer k such that 6*k-1 is composite while 6*k+1 is prime, the number 4 is the first integer m such that 6*m -1 is prime while 6*m+1 is composite, so, 2 = 6 - 4 is the first term a(1) of this sequence. - _Bernard Schott_, Feb 18 2019

%p A121765 := proc(n) option remember; if n = 1 then 6; else for a from procname(n-1)+1 do if 6*a-1 >=4 and not isprime(6*a-1) and isprime(6*a+1) then return a; end if; end do; end if; end proc:

%p A121763 := proc(n) option remember; if n = 1 then 4; else for a from procname(n-1)+1 do if 6*a+1 >=4 and not isprime(6*a+1) and isprime(6*a-1) then return a; end if; end do; end if; end proc:

%p A172054 := proc(n) A121765(n)-A121763(n) ; end proc:

%p seq(A172054(n),n=1..120) ; # _R. J. Mathar_, May 22 2010

%t A121765:= Select[Range[350], !PrimeQ[6#-1] && PrimeQ[6#+1] &];

%t A121763:= Select[Range[350], PrimeQ[6#-1] && !PrimeQ[6#+1] &];

%t Table[A121765[[n]] - A121763[[n]], {n, 1, 80}] (* _G. C. Greubel_, Feb 20 2019 *)

%o (GAP) L:=500;;

%o K:=Filtered([1..L],k-> not IsPrime(6*k-1) and IsPrime(6*k+1));;

%o M:=Filtered([1..L],m-> not IsPrime(6*m+1) and IsPrime(6*m-1));;

%o a:=List([1..Length(K)],i->K[i]-M[i]);; Print(a); # _Muniru A Asiru_, Feb 19 2019

%o (Magma)

%o A121765:=[n: n in [1..350] | not IsPrime(6*n-1) and IsPrime(6*n+1)];

%o A121763:=[n: n in [1..350] | IsPrime(6*n-1) and not IsPrime(6*n+1)];

%o [A121765[n] - A121763[n]: n in [1..80]]; // _G. C. Greubel_, Feb 20 2019

%o (Sage)

%o A121765=[n for n in (1..350) if not is_prime(6*n-1) and is_prime(6*n+1)];

%o A121763=[n for n in (1..350) if is_prime(6*n-1) and not is_prime(6*n+1)];

%o [A121765[n] - A121763[n] for n in (0..80)] # _G. C. Greubel_, Feb 20 2019

%Y Cf. A121763, A171765.

%K nonn

%O 1,1

%A _Juri-Stepan Gerasimov_, Jan 24 2010

%E Entries checked by _R. J. Mathar_, May 22 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 25 10:09 EDT 2024. Contains 374587 sequences. (Running on oeis4.)