|
|
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
|
|
|
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, 17, 19, 13, 13, 10, 11, 9, 8, 7, 15, 17, 18, 13, 12, 13, 13, 11, 11, 15, 19, 19, 23, 23, 19, 12, 16, 17, 12, 11, 18, 22, 27, 29, 27, 27, 25, 18, 27, 28, 23, 22, 23, 17, 21, 24, 23, 23, 30
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Are there negative terms?
The entries are positive for at least the first 250000 terms. - R. J. Mathar, May 22 2010
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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
|
|
MAPLE
|
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:
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:
|
|
MATHEMATICA
|
A121765:= Select[Range[350], !PrimeQ[6#-1] && PrimeQ[6#+1] &];
A121763:= Select[Range[350], PrimeQ[6#-1] && !PrimeQ[6#+1] &];
|
|
PROG
|
(GAP) L:=500;;
K:=Filtered([1..L], k-> not IsPrime(6*k-1) and IsPrime(6*k+1));;
M:=Filtered([1..L], m-> not IsPrime(6*m+1) and IsPrime(6*m-1));;
a:=List([1..Length(K)], i->K[i]-M[i]);; Print(a); # Muniru A Asiru, Feb 19 2019
(Magma)
A121765:=[n: n in [1..350] | not IsPrime(6*n-1) and IsPrime(6*n+1)];
A121763:=[n: n in [1..350] | IsPrime(6*n-1) and not IsPrime(6*n+1)];
(Sage)
A121765=[n for n in (1..350) if not is_prime(6*n-1) and is_prime(6*n+1)];
A121763=[n for n in (1..350) if is_prime(6*n-1) and not is_prime(6*n+1)];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|