|
|
A106002
|
|
a(n)=1 if there is a number of the form 6k+3 such that prime(n) < 6k+3 < prime(n+1), otherwise 0.
|
|
3
|
|
|
0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Except for first two primes and twin primes, there is always at least one number of the form 6k+3 between two successive primes.
|
|
LINKS
|
|
|
EXAMPLE
|
a(3)=0 because between prime(3)=5 and prime(4)=7 there are no numbers of the form 6k+3;
a(4)=1 because between prime(4)=7 and prime(5)=11 there is 9=6*1+3.
|
|
MATHEMATICA
|
Table[If[Prime[n]<6Ceiling[Prime[n]/6]+3<Prime[n+1] || Prime[n]<6Floor[Prime[n]/6]+3<Prime[n+1] , 1, 0], {n, 105}] (* James C. McMahon, Jan 29 2024 *)
|
|
PROG
|
(PARI) a(n) = my(p=prime(n)); for(k=p+1, nextprime(p+1)-1, if (!((k-3) % 6), return(1))); \\ Michel Marcus, Jan 30 2024
(Python)
from sympy import sieve
for comp in range(sieve[n]+1, sieve[n+1]):
if (comp-3) % 6 == 0: return 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|