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-10 of 33 results. Next

A163469 a(n) = A055496(n+1) - 2*A055496(n).

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 3, 3, 3, 9, 15, 11, 11, 3, 3, 5, 9, 63, 3, 15, 5, 11, 15, 31, 1, 3, 21, 13, 9, 9, 31, 39, 15, 7, 25, 21, 35, 11, 9, 39, 53, 53, 81, 21, 5, 23, 9, 39, 17, 21, 19, 3, 77, 5, 39, 57, 41, 29, 45, 21, 11, 15, 13, 39, 17, 33, 67, 129, 33, 13, 3, 5, 105, 67, 7, 13, 3, 15, 63
Offset: 1

Views

Author

Zak Seidov, Jul 28 2009

Keywords

Crossrefs

Cf. A055496.

A006992 Bertrand primes: a(n) is largest prime < 2*a(n-1) for n > 1, with a(1) = 2.

Original entry on oeis.org

2, 3, 5, 7, 13, 23, 43, 83, 163, 317, 631, 1259, 2503, 5003, 9973, 19937, 39869, 79699, 159389, 318751, 637499, 1274989, 2549951, 5099893, 10199767, 20399531, 40799041, 81598067, 163196129, 326392249, 652784471, 1305568919, 2611137817
Offset: 1

Views

Author

Keywords

Comments

a(n) < a(n+1) by Bertrand's postulate (Chebyshev's theorem). - Jonathan Sondow, May 31 2014
Let b(n) = 2^n - a(n). Then b(n) >= 2^(n-1) - 1 and b(n) is a B_2 sequence: 0, 1, 3, 9, 19, 41, 85, 173, 349, ... - Thomas Ordowski, Sep 23 2014 See the link for B_2 sequence.
These primes can be obtained of exclusive form using a restricted variant of Rowland's prime-generating recurrence (A106108), making gcd(n, a(n-1)) = -1 when GCDs are greater than 1 and less than n (see program). These GCDs are also a divisor of each odd number from a(n) + 2 to 2*a(n-1) - 1 in reverse order, so that this subtraction with -1's invariably leads to the prime. - Manuel Valdivia, Jan 13 2015
First row of array in A229607. - Robert Israel, Mar 31 2015
Named after the French mathematician Joseph Bertrand (1822-1900). - Amiram Eldar, Jun 10 2021

References

  • Martin Aigner and Günter M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 1999; see p. 7.
  • Martin Griffiths, The Backbone of Pascal's Triangle, United Kingdom Mathematics Trust (2008), page 115. [From Martin Griffiths, Mar 28 2009]
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 344.
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 189.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A185231 for another version.

Programs

  • Haskell
    a006992 n = a006992_list !! (n-1)
    a006992_list = iterate (a007917 . (* 2)) 2
    -- Reinhard Zumkeller, Sep 17 2014
    
  • Maple
    A006992 := proc(n) option remember; if n=1 then 2 else prevprime(2*A006992(n-1)); fi; end;
  • Mathematica
    bertrandPrime[1] = 2; bertrandPrime[n_] := NextPrime[ 2*a[n - 1], -1]; Table[bertrandPrime[n], {n, 40}]
    (* Second program: *)
    NestList[NextPrime[2#, -1] &, 2, 40] (* Harvey P. Dale, May 21 2012 *)
    k = 3; a[n_] := If[GCD[n,k] > 1 && GCD[n, k] < n, -1, GCD[n, k]]; Select[Differences@Table[k = a[n] + k, {n, 2611137817}], # > 1 &] (* Manuel Valdivia, Jan 13 2015 *)
  • PARI
    print1(t=2);for(i=2,60,print1(", "t=precprime(2*t))) \\ Charles R Greathouse IV, Apr 01 2013
    
  • Python
    from sympy import prevprime
    l = [2]
    for i in range(1, 51):
        l.append(prevprime(2 * l[i - 1]))
    print(l) # Indranil Ghosh, Apr 26 2017

Formula

a(n+1) = A007917(2*a(n)). - Reinhard Zumkeller, Sep 17 2014
Limit_{n -> infinity} a(n)/2^n = 0.303976447924... - Thomas Ordowski, Apr 05 2015

Extensions

Definition completed by Jonathan Sondow, May 31 2014
B_2 sequence link added by Wolfdieter Lang, Oct 09 2014

A051254 Mills primes.

Original entry on oeis.org

2, 11, 1361, 2521008887, 16022236204009818131831320183, 4113101149215104800030529537915953170486139623539759933135949994882770404074832568499
Offset: 1

Views

Author

Keywords

Comments

Mills showed that there is a number A > 1 but not an integer, such that floor( A^(3^n) ) is a prime for all n = 1, 2, 3, ... A is approximately 1.306377883863... (see A051021).
a(1) = 2 and (for n > 1) a(n) is least prime > a(n-1)^3. - Jonathan Vos Post, May 05 2006, corrected by M. F. Hasler, Sep 11 2024
The name refers to the American mathematician William Harold Mills (1921-2007). - Amiram Eldar, Jun 23 2021

Examples

			a(3) = 1361 = 11^3 + 30 = a(2)^3 + 30 and there is no smaller k such that a(2)^3 + k is prime. - _Jonathan Vos Post_, May 05 2006
		

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 8.
  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 2.13, p. 130.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 137.

Crossrefs

Cf. A224845 (integer lengths of Mills primes).
Cf. A108739 (sequence of offsets b_n associated with Mills primes).
Cf. A051021 (decimal expansion of Mills constant).

Programs

  • Maple
    floor(A^(3^n), n=1..10); # A is Mills's constant: 1.306377883863080690468614492602605712916784585156713644368053759966434.. (A051021).
  • Mathematica
    p = 1; Table[p = NextPrime[p^3], {6}] (* T. D. Noe, Sep 24 2008 *)
    NestList[NextPrime[#^3] &, 2, 5] (* Harvey P. Dale, Feb 28 2012 *)
  • PARI
    a(n)=if(n==1, 2, nextprime(a(n-1)^3)) \\ Charles R Greathouse IV, Jun 23 2017
    
  • PARI
    apply( {A051254(n, p=2)=while(n--, p=nextprime(p^3));p}, [1..6]) \\ M. F. Hasler, Sep 11 2024

Formula

a(1) = 2; a(n) is least prime > a(n-1)^3. - Jonathan Vos Post, May 05 2006

Extensions

Edited by N. J. A. Sloane, May 05 2007

A059788 a(n) = largest prime < 2*prime(n).

Original entry on oeis.org

3, 5, 7, 13, 19, 23, 31, 37, 43, 53, 61, 73, 79, 83, 89, 103, 113, 113, 131, 139, 139, 157, 163, 173, 193, 199, 199, 211, 211, 223, 251, 257, 271, 277, 293, 293, 313, 317, 331, 337, 353, 359, 379, 383, 389, 397, 421, 443, 449, 457, 463, 467, 479, 499, 509, 523
Offset: 1

Views

Author

Labos Elemer, Feb 22 2001

Keywords

Comments

Also, smallest member of the first pair of consecutive primes such that between them is a composite number divisible by the n-th prime. - Amarnath Murthy, Sep 25 2002
Except for its initial term, A006992 is a subsequence based on iteration of n -> A151799(2n). The range of this sequence is a subset of A065091. - M. F. Hasler, May 08 2016

Examples

			n=18: p(18)=61, so a(18) is the largest prime below 2*61=122, which is 113.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    A059788 := proc(n)
        prevprime(2*ithprime(n)) ;
    end proc:
    seq(A059788(n),n=1..50) ; # R. J. Mathar, May 08 2016
  • Mathematica
    a[n_] := Prime[PrimePi[2Prime[n]]]
    NextPrime[2*Prime[Range[100]], -1] (* Zak Seidov, May 08 2016 *)
  • PARI
    a(n) = precprime(2*prime(n)); \\ Michel Marcus, May 08 2016

Formula

a(n) = A007917(A100484(n)). - R. J. Mathar, May 08 2016

A116533 a(1)=1, a(2)=2, for n > 2 if a(n-1) is prime, then a(n) = 2*a(n-1), otherwise a(n) = a(n-1) - 1.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 9, 8, 7, 14, 13, 26, 25, 24, 23, 46, 45, 44, 43, 86, 85, 84, 83, 166, 165, 164, 163, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 634, 633, 632, 631, 1262, 1261, 1260, 1259, 2518, 2517, 2516, 2515, 2514, 2513, 2512, 2511, 2510, 2509, 2508
Offset: 1

Views

Author

Rodolfo Kurchan, Mar 26 2006

Keywords

Comments

For n >= 3, using Wilson's theorem, a(n) = a(n-1) + (-1)^r*gcd(a(n-1), W), where W = A038507(a(n-1) - 1), and r=1 if gcd(a(n-1), W) = 1 and r=0 otherwise. - Vladimir Shevelev, Aug 07 2009

Crossrefs

Programs

  • Maple
    a[1]:=1: a[2]:=2: for n from 3 to 60 do if isprime(a[n-1])=true then a[n]:=2*a[n-1] else a[n]:=a[n-1]-1 fi od: seq(a[n],n=1..60); # Emeric Deutsch, Apr 02 2006

Extensions

More terms from Emeric Deutsch, Apr 02 2006

A163961 First differences of A116533.

Original entry on oeis.org

1, 2, -1, 3, -1, 5, -1, -1, -1, 7, -1, 13, -1, -1, -1, 23, -1, -1, -1, 43, -1, -1, -1, 83, -1, -1, -1, 163, -1, -1, -1, -1, -1, -1, -1, -1, -1, 317, -1, -1, -1, 631, -1, -1, -1, 1259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2503, -1, -1, -1, 5003, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Offset: 1

Views

Author

Vladimir Shevelev, Aug 07 2009, Aug 14 2009

Keywords

Comments

Ignoring the +-1 terms, we obtain the sequence of Bertrand's primes A006992. If we consider sequences A_i={a_i(n)}, i=1,2,... with the same constructions as A116533, but with initials a_1(1)=2, a_2(1)=11, a_3(1)=17,..., a_m(1)=A164368(m),..., then the union of A_1,A_2,... contains all primes.

Crossrefs

Programs

  • Maple
    A116533 := proc(n) option remember; if n <=2 then n; else if isprime(procname(n-1)) then 2*procname(n-1) ; else procname(n-1)-1 ; end if; end if; end proc:
    A163961 := proc(n) A116533(n+1)-A116533(n) ; end proc: # R. J. Mathar, Sep 03 2011
  • Mathematica
    Differences@ Prepend[NestList[If[PrimeQ@ #, 2 #, # - 1] &, 2, 90], 1] (* Michael De Vlieger, Dec 06 2018 *)
  • PARI
    a116533(n) = if(n==1, 1, if(n==2, 2, if(ispseudoprime(a116533(n-1)), 2*a116533(n-1), a116533(n-1)-1)))
    a(n) = a116533(n+1)-a116533(n) \\ Felix Fröhlich, Dec 06 2018
    
  • PARI
    lista(nn) = {va = vector(nn); va[1] = 1; va[2] = 2; for (n=3, nn, va[n] = if (isprime(va[n-1]), 2*va[n-1], va[n-1]-1);); vector(nn-1, n, va[n+1] - va[n]);} \\ Michel Marcus, Dec 07 2018

A163963 First differences of A080735.

Original entry on oeis.org

1, 2, 1, 5, 1, 11, 1, 23, 1, 47, 1, 1, 1, 97, 1, 1, 1, 197, 1, 1, 1, 397, 1, 1, 1, 797, 1, 1, 1, 1597, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3203, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6421, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12853, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25717, 1, 1, 1, 51437, 1, 1, 1
Offset: 1

Views

Author

Vladimir Shevelev, Aug 07 2009

Keywords

Comments

Ignoring the 1 terms we obtain A055496. If we consider sequences A_i={a_i(n)}, i=1,2,... with the same constructions as A080735, but with initials a_1(1)=2, a_2(1)=3, a_3(1)=13,..., a_m(1)=A080359(m),..., then the union of A_1,A_2,... contains all primes.

Crossrefs

Programs

  • Maple
    A080735 := proc(n) option remember; local p ; if n = 1 then 1; else p := procname(n-1) ; if isprime(p) then 2*p; else p+1 ; end if; end if; end proc: A163963 := proc(n) A080735(n+1)-A080735(n) ; end: seq(A163963(n),n=1..100) ; # R. J. Mathar, Nov 05 2009
  • Mathematica
    Differences@ NestList[If[PrimeQ@ #, 2 #, # + 1] &, 1, 87] (* Michael De Vlieger, Dec 06 2018, after Harvey P. Dale at A080735 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = if (isprime(va[n-1]), 2*va[n-1], va[n-1]+1);); vector(nn-1, n, va[n+1] - va[n]);} \\ Michel Marcus, Dec 06 2018

Extensions

More terms from R. J. Mathar, Nov 05 2009

A059786 Smallest prime after 2*(n-th prime).

Original entry on oeis.org

5, 7, 11, 17, 23, 29, 37, 41, 47, 59, 67, 79, 83, 89, 97, 107, 127, 127, 137, 149, 149, 163, 167, 179, 197, 211, 211, 223, 223, 227, 257, 263, 277, 281, 307, 307, 317, 331, 337, 347, 359, 367, 383, 389, 397, 401, 431, 449, 457, 461, 467, 479, 487, 503, 521
Offset: 1

Views

Author

Labos Elemer, Feb 22 2001

Keywords

Examples

			n=17, 18, p(17)=59, p(18)=61, after 118 and 122 the next prime is 127, so a(17)=a(18)=127.
		

Crossrefs

Programs

  • Maple
    with(numtheory): [seq(nextprime(2*ithprime(k)),k=1..256)];
  • Mathematica
    NextPrime/@(2*Prime[Range[60]]) (* Harvey P. Dale, May 03 2019 *)
  • PARI
    a(n) = nextprime(2*prime(n)+1); \\ Michel Marcus, Sep 21 2017

Formula

a(n) = A117928(n,1) for n>1. - Reinhard Zumkeller, Apr 03 2006

A076656 a(1) = 2; a(n) is smallest prime > 3*a(n-1).

Original entry on oeis.org

2, 7, 23, 71, 223, 673, 2027, 6089, 18269, 54829, 164503, 493523, 1480571, 4441721, 13325171, 39975553, 119926691, 359780077, 1079340313, 3238020943, 9714062893, 29142188683, 87426566057, 262279698173, 786839094529
Offset: 1

Views

Author

Cino Hilliard, Oct 24 2002

Keywords

Crossrefs

Cf. A055496.

Programs

  • Mathematica
    PrimeNext[n_]:=Module[{k},k=n+1;While[ !PrimeQ[k],k++ ];k]; p=2;lst={p};Do[p=PrimeNext[3*p];AppendTo[lst,p],{n,2*4!}];lst (* Vladimir Joseph Stephan Orlovsky, May 27 2009 *)
    NestList[NextPrime[3#]&,2,30] (* Harvey P. Dale, Aug 12 2016 *)

Extensions

Edited by Don Reble, May 03 2006

A065122 a(1) = 2; a(n) is smallest prime > 10*a(n-1).

Original entry on oeis.org

2, 23, 233, 2333, 23333, 233341, 2333459, 23334601, 233346041, 2333460413, 23334604169, 233346041759, 2333460417637, 23334604176379, 233346041763823, 2333460417638239, 23334604176382489, 233346041763824911
Offset: 1

Views

Author

Henry Bottomley, Nov 13 2001

Keywords

Crossrefs

Programs

  • Mathematica
    NextPrim[n_Integer] := Block[ {k = n + 1}, While[ !PrimeQ[k], k++ ]; Return[k]]; a[1] = 2; a[n_] := NextPrim[ 10*a[n - 1]]; Table[ a[n], {n, 1, 20} ]
    NestList[NextPrime[10#]&,2,20] (* Harvey P. Dale, Jun 03 2012 *)
  • PARI
    { for (n=1, 100, if (n>1, a=nextprime(10*a), a=2); write("b065122.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 10 2009

Extensions

More terms from Robert G. Wilson v, Nov 28 2001
Showing 1-10 of 33 results. Next