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!)
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

%I #16 Jan 30 2024 08:23:40

%S 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,

%T 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,

%U 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

%N a(n)=1 if there is a number of the form 6k+3 such that prime(n) < 6k+3 < prime(n+1), otherwise 0.

%C Except for first two primes and twin primes, there is always at least one number of the form 6k+3 between two successive primes.

%H Karl-Heinz Hofmann, <a href="/A106002/b106002.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3)=0 because between prime(3)=5 and prime(4)=7 there are no numbers of the form 6k+3;

%e a(4)=1 because between prime(4)=7 and prime(5)=11 there is 9=6*1+3.

%t 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 *)

%o (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

%o (Python)

%o from sympy import sieve

%o def A106002(n):

%o for comp in range(sieve[n]+1, sieve[n+1]):

%o if (comp-3) % 6 == 0: return 1

%o return 0 # _Karl-Heinz Hofmann_, Jan 30 2024

%Y Same as A100810 after first term.

%K easy,nonn

%O 1,1

%A _Giovanni Teofilatto_, Apr 29 2005

%E Edited by _Ray Chandler_, Oct 17 2006

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 April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)