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.

Showing 1-3 of 3 results.

A100821 a(n) = 1 if prime(n) + 2 = prime(n+1), otherwise 0.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 06 2005

Keywords

Comments

Same as A062301 except for starting point.
a(n)=1 iff prime(n) is the smaller of a pair of twin primes, else a(n)=0. This sequence can be derived from the sequence b(n)=1 iff n and n+2 are both prime, else b(n)=0. This latter sequence has as its inverse Moebius transform the sequence c(n) = the number of distinct factors of n which are the smaller of a pair of twin primes. For example, c(15)=2 because 15 is divisible by 3 and 5, each of which is the smaller of a pair of twin primes. - Jonathan Vos Post, Jan 07 2005

Programs

  • Mathematica
    Table[If[Prime[n] + 2 == Prime[n + 1], 1, 0], {n, 120}] (* Ray Chandler, Jan 09 2005 *)

Formula

a(n) = A062301(n+1) = 1 - A100810(n).

Extensions

Corrected and extended by Ray Chandler, Jan 09 2005

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Giovanni Teofilatto, Apr 29 2005

Keywords

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.

Examples

			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.
		

Crossrefs

Same as A100810 after first term.

Programs

  • Mathematica
    Table[If[Prime[n]<6Ceiling[Prime[n]/6]+3James C. McMahon, Jan 29 2024 *)
  • 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
    def A106002(n):
        for comp in range(sieve[n]+1, sieve[n+1]):
            if (comp-3) % 6 == 0: return 1
        return 0 # Karl-Heinz Hofmann, Jan 30 2024

Extensions

Edited by Ray Chandler, Oct 17 2006

A105470 a(n)=1 if there is number of the form 6k+3 with prime(n) <= 6k+3 <= prime(n+1), otherwise 0.

Original entry on oeis.org

1, 1, 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
Offset: 1

Views

Author

Giovanni Teofilatto, May 02 2005

Keywords

Comments

Except for the first pair of primes and for twin primes there is always at least one number of the form 6n+3 between two successive primes.

Examples

			a(3)=0 because between prime(3) and prime(4) there are no numbers of the form 6k+3;
a(4)=1 because between prime(4) and prime(5) there is one number of the form 6k+3: 9.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Count[Table[Mod[k, 6], {k, Prime[n], Prime[n + 1]}], 3];Table[If[f[n] == 0, 0, 1], {n, 120}] (* Ray Chandler, Oct 17 2006 *)
    Join[{1,1},If[Last[#]-First[#]==2,0,1]&/@Partition[Prime[Range[ 3,200]],2,1]] (* Harvey P. Dale, Nov 27 2013 *)

Extensions

Edited by Ray Chandler, Oct 17 2006
Showing 1-3 of 3 results.