cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A106002 #16 Jan 30 2024 08:23:40
%S A106002 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 A106002 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 A106002 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 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.
%C A106002 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 A106002 Karl-Heinz Hofmann, <a href="/A106002/b106002.txt">Table of n, a(n) for n = 1..10000</a>
%e A106002 a(3)=0 because between prime(3)=5 and prime(4)=7 there are no numbers of the form 6k+3;
%e A106002 a(4)=1 because between prime(4)=7 and prime(5)=11 there is 9=6*1+3.
%t A106002 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 A106002 (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 A106002 (Python)
%o A106002 from sympy import sieve
%o A106002 def A106002(n):
%o A106002     for comp in range(sieve[n]+1, sieve[n+1]):
%o A106002         if (comp-3) % 6 == 0: return 1
%o A106002     return 0 # _Karl-Heinz Hofmann_, Jan 30 2024
%Y A106002 Same as A100810 after first term.
%K A106002 easy,nonn
%O A106002 1,1
%A A106002 _Giovanni Teofilatto_, Apr 29 2005
%E A106002 Edited by _Ray Chandler_, Oct 17 2006