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

A062044 Primes arising in A062042.

Original entry on oeis.org

2, 5, 7, 11, 17, 23, 29, 37, 43, 47, 53, 59, 67, 73, 79, 89, 97, 101, 103, 107, 113, 127, 139, 149, 163, 173, 179, 181, 191, 211, 223, 227, 233, 239, 251, 263, 269, 277, 283, 293, 307, 313, 317, 331, 347, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419
Offset: 1

Views

Author

Amarnath Murthy, Jun 05 2001

Keywords

Examples

			7 and 10 are two consecutive terms of A062042 and their sum 7+10 = 17 is prime and is a member.
		

Crossrefs

Cf. A062042.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 07 2001

A073627 a(1)=a(2)=1; for n > 2, a(n) is the smallest integer such that a(n) > a(n-1) and a(n)+a(n-1) is prime.

Original entry on oeis.org

1, 1, 2, 3, 4, 7, 10, 13, 16, 21, 22, 25, 28, 31, 36, 37, 42, 47, 50, 51, 52, 55, 58, 69, 70, 79, 84, 89, 90, 91, 100, 111, 112, 115, 118, 121, 130, 133, 136, 141, 142, 151, 156, 157, 160, 171, 176, 177, 182, 185, 188, 191, 192, 197, 200, 201, 208, 211, 220, 223
Offset: 1

Views

Author

Amarnath Murthy, Aug 08 2002

Keywords

Comments

Essentially the same as A062042. [John W. Layman, Oct 11 2013]

Crossrefs

Cf. A073628.

Programs

  • Mathematica
    s=1; Join[{1,1}, Table[k=s+1; While[ !PrimeQ[k+s], k++ ]; s=k, {100}]] (* T. D. Noe, Nov 02 2009 *)
  • PARI
    FirstTerms(n)={my(x=1,y,a=vector(n),j=2);a[1]=1;a[2]=1;while(j++<=n,y=x+1;while(!isprime(x+y),y++);x=y;a[j]=y);return(a)} \\ R. J. Cano, Jan 18 2017

Extensions

Edited by Matthew Conroy, Oct 21 2002
Definition corrected by T. D. Noe, Nov 02 2009

A214362 Arithmetic mean of next a(n) successive positive integers is prime.

Original entry on oeis.org

3, 3, 1, 7, 5, 7, 5, 11, 1, 7, 5, 7, 9, 3, 9, 11, 5, 3, 1, 7, 5, 23, 1, 19, 9, 11, 1, 3, 17, 23, 1, 7, 5, 7, 17, 7, 5, 11, 1, 19, 9, 3, 5, 23, 9, 3, 9, 7, 5, 7, 1, 11, 5, 3, 13, 7, 17, 7, 5, 11, 1, 7, 17, 7, 9, 11, 13, 27, 5, 7, 5, 11, 9, 3, 9, 7, 5, 3, 1, 23, 1
Offset: 1

Views

Author

Alex Ratushnyak, Jul 18 2012

Keywords

Comments

Corresponding primes: A062044(n).
All terms are odd. - Robert Israel, Jan 17 2017

Examples

			(1+2+3)/3 = 2 is prime, so a(1)=3,
then (4+5+6)/3 = 5 is prime, so a(2)=3,
then 7/1 = 7 is prime, so a(3)=1,
then (8+9+10+11+12+13+14)/7 = 11 is prime, so a(4)=7.
		

Crossrefs

Programs

  • Maple
    t:= 1:
    for n from 1 to 100 do
      for s from 1 by 2 do
        if isprime((2*t + s - 1)/2) then
          A[n]:= s; t:= t+s; break
        fi
    od od:
    seq(A[n],n=1..100); # Robert Israel, Jan 17 2017
  • PARI
    firstTerms(n)={
    my(k=1,j=1,x,y,a=vector(n));
    while(j<=n,x=0;while(!isprime(k+x),x++);y=2*x+1;k+=y;a[j]=y;j++);
    return(a)} \\ R. J. Cano, Jan 17 2017

Formula

a(n) = 2*(A062042(n)-A062042(n-1))+(-1)^n for n >= 2. - Robert Israel, Jan 17 2017

A215099 a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is prime.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 8, 10, 11, 13, 18, 24, 25, 29, 34, 38, 39, 41, 44, 48, 53, 55, 56, 58, 71, 73, 78, 84, 85, 89, 94, 102, 103, 109, 120, 124, 131, 133, 138, 144, 145, 149, 162, 164, 169, 173, 178, 180, 181, 187, 192, 196, 197, 201
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Comments

For n>0 and (n mod 4)<2, a(n) is odd.
Same definition, but k+a(n-2) is a
Fibonacci number: A006498 except first two terms,
Lucas number: A000045 except first two terms,
Pell number: A089928(n-1),
Jacobsthal number: A215095,
factorial: A215096,
square: A194274,
cube: A215097,
triangular number: A011848(n+2),
oblong number: A215098.
Example of a related sequence definition: a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is a cube.

Crossrefs

Cf. A062042: a(1) = 2, a(n) = least k>a(n-1) such that k+a(n-1) is a prime.

Programs

  • PARI
    first(n) = my(res = vector(n, i, i-1), k); for(x=3, n, k=res[x-1]+1; while(!isprime(k+res[x-2]), k++); res[x]=k); res \\ Iain Fox, Apr 22 2019 (corrected by Iain Fox, Apr 25 2019)
  • Python
    from sympy import prime
    prpr = 0
    prev = 1
    for n in range(77):
        print(prpr, end=', ')
        b = c = 0
        while c<=prev:
            c = prime(b+1) - prpr
            b+=1
        prpr = prev
        prev = c
    

A231507 a(n) is smallest number greater than a(n-1) such that a(n)+a(n-1) is composite.

Original entry on oeis.org

4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 18, 20, 22, 23, 25, 26, 28, 29, 31, 32, 33, 35, 37, 38, 39, 41, 43, 44, 46, 47, 48, 50, 52, 53, 55, 56, 58, 59, 60, 61, 62, 63, 65, 67, 68, 70, 71, 72, 73, 74, 76, 77, 78, 80, 81, 83, 85, 86, 88, 89, 91, 92, 93, 94, 95, 97
Offset: 1

Views

Author

Neil Fernandez, Nov 09 2013

Keywords

Examples

			a(1) = 4, the first composite. So the smallest a(2) could possibly be 5. 4+5=9, which is composite, so a(2) = 5. a(3) cannot be 6, because 5+6=11, which is prime. But 5+7=12 is composite, so a(3) = 7.
		

Crossrefs

Programs

  • Mathematica
    nxt[n_]:=Module[{k=n+1},While[PrimeQ[n+k],k++];k]; NestList[nxt,4,70] (* Harvey P. Dale, Jul 18 2014 *)

A107817 Slowest increasing sequence where 2 consecutive integers sum up to a prime.

Original entry on oeis.org

0, 2, 3, 4, 7, 10, 13, 16, 21, 22, 25, 28, 31, 36, 37, 42, 47, 50, 51, 52, 55, 58, 69, 70, 79, 84, 89, 90, 91, 100, 111, 112, 115, 118, 121, 130, 133, 136, 141, 142, 151, 156, 157, 160, 171, 176, 177, 182, 185, 188, 191, 192, 197, 200, 201, 208, 211, 220, 223, 226
Offset: 0

Views

Author

Eric Angelini, Jun 11 2005

Keywords

Comments

Essentially the same as A073627. [R. J. Mathar, Aug 24 2008]
Essentially the same as A062042. [Zak Seidov, Nov 04 2009]

Examples

			0+2=2, which is a prime; 2+3=5=prime; 3+4=7=prime; 4+7=11=prime, etc.
		

Programs

  • Mathematica
    k = 0; Print[k]; Do[p = k + 1; While[ !PrimeQ[k + p], p++ ]; k = p; Print[k], {n, 1, 100}] (* Ryan Propper, Sep 04 2005 *)

Extensions

More terms from Ryan Propper, Sep 04 2005

A330248 a(1) = 1; for n > 1, a(n) is the least nonnegative number such that a(n) + a(n-1) + n is a prime number.

Original entry on oeis.org

1, 0, 0, 1, 1, 0, 0, 3, 1, 0, 0, 1, 3, 0, 2, 1, 1, 0, 0, 3, 5, 2, 4, 1, 3, 0, 2, 1, 1, 0, 0, 5, 3, 0, 2, 3, 1, 2, 0, 1, 1, 0, 0, 3, 5, 2, 4, 1, 3, 0, 2, 5, 1, 4, 0, 3, 1, 0, 0, 1, 5, 0, 4, 3, 3, 2, 2, 1, 1, 0, 0, 1, 5, 0, 4, 3, 3, 2, 2, 1, 1, 0, 0, 5, 7, 4, 6
Offset: 1

Views

Author

Ali Sada, Dec 06 2019

Keywords

Comments

The primes that result from this sequence are 3, 3, 5, 7, 7, 7, 11, 13, 11, 11, 13, 17, 17, 17, 19, 19, 19, 19, 23, 29, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 37, 41, 37, 37, 41, ...

Examples

			When n=5, a(4)=1; we want a(5)+a(4)+5 to be a prime. 1 is the least nonnegative number that satisfies this condition (1+5+1=7). So, a(5)=1.
		

Crossrefs

Cf. A062042.

Programs

  • Mathematica
    Nest[Append[#1, Block[{k = 0}, While[! PrimeQ[#1[[-1]] + k + #2], k++]; k]] & @@ {#, Length@ # + 1} &, {1}, 105] (* Michael De Vlieger, Dec 14 2019 *)
  • PARI
    for (n=1, 87, print1 (v=if (n==1, 1, nextprime(n+v)-n-v)", ")) \\ Rémy Sigrist, Dec 06 2019
Showing 1-7 of 7 results.