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-5 of 5 results.

A075526 a(n) = A008578(n+2) - A008578(n+1).

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 8, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6, 4, 6, 8, 4, 2, 4, 12, 8, 4, 8, 4, 6
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 22 2002

Keywords

Comments

n appears this number of times in A000720. - Lekraj Beedassy, Jun 19 2006
a(0) = 1, for n >= 1: a(n) = differences between consecutive primes (A001223(n)) = A158611(n+2) - A158611(n+1). Partial sums give A006093 (shifted). - Jaroslav Krizek, Aug 04 2009
First differences of noncomposite numbers. - Juri-Stepan Gerasimov, Feb 17 2010
This is 1 together with A001223. A054541 is 2 together with A001223. A125266 is 3 together with A001223. - Omar E. Pol, Nov 01 2013

Crossrefs

Programs

Formula

a(n) = A001223(n) for n>0.

Extensions

Correction for change of offset in A158611 and A008578 in Aug 2009 Jaroslav Krizek, Jan 27 2010

A031131 Difference between n-th prime and (n+2)-nd prime.

Original entry on oeis.org

3, 4, 6, 6, 6, 6, 6, 10, 8, 8, 10, 6, 6, 10, 12, 8, 8, 10, 6, 8, 10, 10, 14, 12, 6, 6, 6, 6, 18, 18, 10, 8, 12, 12, 8, 12, 10, 10, 12, 8, 12, 12, 6, 6, 14, 24, 16, 6, 6, 10, 8, 12, 16, 12, 12, 8, 8, 10, 6, 12, 24, 18, 6, 6, 18, 20, 16, 12, 6, 10, 14, 14, 12, 10, 10, 14, 12, 12, 18, 12, 12, 12
Offset: 1

Views

Author

Keywords

Comments

Distance between the pair of primes adjacent to the (n+1)-st prime. - Lekraj Beedassy, Oct 01 2004 [Typo corrected by Zak Seidov, Feb 22 2009]
A031131(A261525(n)) = 2*n and A031131(m) != 2*n for m < A261525(n). - Reinhard Zumkeller, Aug 23 2015
The Polymath project 8b proved that a(n) <= 395106 infinitely often (their published paper contains the slightly weaker bound a(n) <= 398130 infinitely often). - Charles R Greathouse IV, Jul 22 2016

Examples

			a(10)=8 because the 10th prime=29 is followed by primes 31 and 37, and 37 - 29 = 8.
		

Crossrefs

Sum of consecutive terms of A001223.
Cf. A075527 (allowing 1 to be prime).
First differences of A001043.

Programs

  • Haskell
    a031131 n = a031131_list !! (n-1)
    a031131_list = zipWith (-) (drop 2 a000040_list) a000040_list
    -- Reinhard Zumkeller, Dec 19 2013
  • Magma
    [NthPrime(n+2)-NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 11 2011
    
  • Maple
    P:= select(isprime, [2,seq(2*i+1,i=1..1000)]):
    P[3..-1] - P[1..-3]; # Robert Israel, Jan 25 2015
  • Mathematica
    Differences[lst_]:=Drop[lst,2]-Drop[lst,-2]; Differences[Prime[Range[123]]] (* Vladimir Joseph Stephan Orlovsky, Aug 13 2009 *)
    Map[#3 - #1 & @@ # &, Partition[Prime@ Range[84], 3, 1]] (* Michael De Vlieger, Dec 17 2017 *)
  • MuPAD
    ithprime(i+2)-ithprime(i) $ i = 1..65 // Zerinvary Lajos, Feb 26 2007
    
  • PARI
    a(n)=my(p=prime(n));nextprime(nextprime(p+1)+1)-p \\ Charles R Greathouse IV, Jul 01 2013
    
  • Sage
    BB = primes_first_n(67)
    L = []
    for i in range(65):
        L.append(BB[2+i]-BB[i])
    L
    # Zerinvary Lajos, May 14 2007
    

Formula

a(n) = A001223(n) + A001223(n-1). - Lior Manor, Jan 19 2005
a(n) = A000040(n+2) - A000040(n).
a(n) = 2*A052288(n-1) for n>1. - Hugo Pfoertner, Apr 16 2025

Extensions

Corrected by T. D. Noe, Sep 11 2008
Edited by N. J. A. Sloane, Sep 18 2008, at the suggestion of T. D. Noe

A076272 Largest prime factor of A076271(n): A006530(A076271(n)).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 37, 37, 37, 37
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 04 2002

Keywords

Crossrefs

See A180101 for a variant.

Programs

  • Mathematica
    Differences[NestList[#+FactorInteger[#][[-1,1]]&,1,100]] (* Paolo Xausa, Dec 09 2023 *)

Formula

a(n) = A076271(n+1) - A076271(n) for all n;
a(A076273(k)+j) = A008578(k) for k>0 and 0 <= j < A075527(k-1).

A076273 a(0) = 1, a(1) = 2; for n>1, a(n) = prime(n)+prime(n-1)-1.

Original entry on oeis.org

1, 2, 4, 7, 11, 17, 23, 29, 35, 41, 51, 59, 67, 77, 83, 89, 99, 111, 119, 127, 137, 143, 151, 161, 171, 185, 197, 203, 209, 215, 221, 239, 257, 267, 275, 287, 299, 307, 319, 329, 339, 351, 359, 371, 383, 389, 395, 409, 433, 449, 455, 461, 471, 479, 491, 507, 519, 531
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 04 2002

Keywords

Comments

Least m such that A076272(m) > A076272(m-1) for n>0; a(0)=1.
A076272(a(k)+j) = A008578(k) for k>0 and 0<=j < A075527(k-1).

Crossrefs

Cf. A001043.

Programs

  • Mathematica
    nxt[{a_,b_}]:={a+1,Prime[a+1]+Prime[a]-1}; Join[{1},Transpose[ NestList[ nxt,{1,2},60]][[2]]] (* or *) Join[{1,2},Total/@Partition[Prime[ Range[ 60]],2,1]-1] (* Harvey P. Dale, Jun 12 2012 *)
  • PARI
    a(n)=if(n<1,1,if(n==1,2,prime(n)+prime(n-1)-1)) \\ Lambert Klasen, Jan 14 2005; corrected by Michel Marcus, Nov 05 2023

Formula

a(n) = A001043(n-1)-1, n>1. - R. J. Mathar, Jun 04 2020

Extensions

Simpler description from Vladeta Jovovic, Mar 29 2003
More terms from Lambert Klasen (lambert.klasen(AT)gmx.de), Jan 14 2005

A261468 a(n) = prime(n+2) mod prime(n).

Original entry on oeis.org

1, 1, 1, 6, 6, 6, 6, 10, 8, 8, 10, 6, 6, 10, 12, 8, 8, 10, 6, 8, 10, 10, 14, 12, 6, 6, 6, 6, 18, 18, 10, 8, 12, 12, 8, 12, 10, 10, 12, 8, 12, 12, 6, 6, 14, 24, 16, 6, 6, 10, 8, 12, 16, 12, 12, 8, 8, 10, 6, 12, 24, 18, 6, 6, 18, 20, 16, 12, 6, 10, 14, 14, 12
Offset: 1

Views

Author

Altug Alkan, Aug 20 2015

Keywords

Examples

			a(3) = 11 mod 5 = 1.
		

Crossrefs

Cf. A031131.

Programs

  • Magma
    [NthPrime(n+2) mod NthPrime(n): n in [1..80]]; // Vincenzo Librandi, Aug 20 2015
  • Mathematica
    a[n_]:=PowerMod[Prime[n + 2], 1, Prime[n]]; Table[a[n], {n, 80}] (* Vincenzo Librandi, Aug 20 2015 *)
    Mod[#[[3]],#[[1]]]&/@Partition[Prime[Range[80]],3,1] (* Harvey P. Dale, Mar 14 2020 *)
  • PARI
    first(m)=vector(m,i,prime(i+2)% prime(i)); \\ Anders Hellström, Aug 20 2015
    

Formula

a(n) = A031131(n) = A075527(n) for n>3. - Alois P. Heinz, Aug 20 2015
Showing 1-5 of 5 results.