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
Muniru A Asiru, Table of n, a(n) for n = 1..20000
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:
seq(A172054(n), n=1..120) ; # R. J. Mathar, May 22 2010
MATHEMATICA
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
Juri-Stepan Gerasimov, Jan 24 2010
EXTENSIONS
Entries checked by R. J. Mathar, May 22 2010
STATUS
approved