[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Search: a163961 -id:a163961
     Sort: relevance | references | number | modified | created      Format: long | short | data
Bertrand primes: a(n) is largest prime < 2*a(n-1) for n > 1, with a(1) = 2.
(Formerly M0675)
+10
32
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,1
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).
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1001 (first 100 terms from T. D. Noe)
Paul Erdős, Beweis eines Satzes von Tschebyschef (in German), Acta Litt. Sci. Szeged, Vol. 5 (1932), pp. 194-198.
Paul Erdős, A theorem of Sylvester and Schur, J. London Math. Soc., Vol. 9 (1934), pp. 282-288.
Srinivasa Ramanujan, A proof of Bertrand's postulate, J. Indian Math. Soc., Vol. 11 (1919), pp. 181-182.
Vladimir Shevelev, Ramanujan and Labos primes, their generalizations, and classifications of primes, J. Integer Seq., Vol. 15 (2012) Article 12.5.4.
Jonathan Sondow, Ramanujan primes and Bertrand's postulate, arXiv:0907.5232 [math.NT], 2009-2010.
Jonathan Sondow, Ramanujan primes and Bertrand's postulate, Amer. Math. Monthly, Vol. 116, No. 7 (2009), pp. 630-635.
Jonathan Sondow and Eric Weisstein, MathWorld: Bertrand's Postulate.
Eric Weisstein's World of Mathematics, B2 Sequence.
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
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 *)
PROG
(PARI) print1(t=2); for(i=2, 60, print1(", "t=precprime(2*t))) \\ Charles R Greathouse IV, Apr 01 2013
(Haskell)
a006992 n = a006992_list !! (n-1)
a006992_list = iterate (a007917 . (* 2)) 2
-- Reinhard Zumkeller, Sep 17 2014
(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
CROSSREFS
See A185231 for another version.
KEYWORD
nonn,nice
EXTENSIONS
Definition completed by Jonathan Sondow, May 31 2014
B_2 sequence link added by Wolfdieter Lang, Oct 09 2014
STATUS
approved
First differences of A080735.
+10
13
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,2
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.
LINKS
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 *)
PROG
(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
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Aug 07 2009
EXTENSIONS
More terms from R. J. Mathar, Nov 05 2009
STATUS
approved
a(1)=3; for n > 1, a(n) = 1 + a(n-1) + gcd( a(n-1)*(a(n-1)+2), A073829(a(n-1)) ).
+10
11
3, 19, 39, 81, 165, 333, 335, 673, 1347, 1349, 1351, 1353, 1355, 1357, 1359, 2721, 2723, 2725, 2727, 5457, 5459, 5461, 5463, 5465, 5467, 5469, 10941, 10943, 10945, 10947, 21897, 21899, 21901, 21903, 21905, 21907, 21909, 43821, 43823, 43825, 43827, 43829, 43831
OFFSET
1,1
COMMENTS
The first differences are 16, 20, 42, etc. They are either 2 or in A075369 or in A008864, see A167054.
A proof follows from Clement's criterion of twin primes.
REFERENCES
E. Trost, Primzahlen, Birkhäuser-Verlag, 1953, pages 30-31.
LINKS
P. A. Clement, Congruences for sets of primes, Amer. Math. Monthly, 56 (1949), 23-25.
EXAMPLE
a(2) = 1 + 3 + gcd(3*5, 4*(2! + 1) + 3) = 19.
MAPLE
A073829 := proc(n) n+4*((n-1)!+1) ; end proc:
A167053 := proc(n) option remember ; local aprev; if n = 1 then 3; else aprev := procname(n-1) ; 1+aprev+gcd(aprev*(aprev+2), A073829(aprev)) ; end if; end proc:
seq(A167053(n), n=1..60) ; # R. J. Mathar, Dec 17 2009
MATHEMATICA
A073829[n_] := 4((n-1)! + 1) + n;
a[1] = 3;
a[n_] := a[n] = 1 + a[n-1] + GCD[a[n-1] (a[n-1] + 2), A073829[a[n-1]]];
Array[a, 60] (* Jean-François Alcover, Mar 25 2020 *)
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Oct 27 2009
EXTENSIONS
Definition shortened and values from a(4) on replaced by R. J. Mathar, Dec 17 2009
STATUS
approved
Values of A167053(k)-A167053(k-1)-1 not equal to 1.
+10
9
15, 19, 41, 83, 167, 337, 673, 1361, 2729, 5471, 10949, 21911, 43853, 87719, 175447, 350899, 701819, 1403641, 2807303, 5614657, 11229331, 22458671, 44917381, 89834777, 179669557, 359339171, 718678369
OFFSET
1,1
COMMENTS
All terms of the sequence are primes or products of twin primes (A037074).
KEYWORD
nonn,more
AUTHOR
Vladimir Shevelev, Oct 27 2009
EXTENSIONS
Values from a(3) on replaced by R. J. Mathar, Dec 17 2009
More terms from Amiram Eldar, Sep 13 2019
STATUS
approved
a(6) = 14, for n >= 7, a(n) = a(n-1) + gcd(n, a(n-1)).
+10
8
14, 21, 22, 23, 24, 25, 26, 39, 40, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 177, 180, 181, 182, 189, 190, 195
OFFSET
6,1
COMMENTS
For every n >= 7, a(n) - a(n-1) is 1 or prime. This Rowland-like "generator of primes" is different from A106108 (see comment to A167168).
LINKS
Eric S. Rowland, A natural prime-generating recurrence, J. of Integer Sequences 11 (2008), Article 08.2.8.
MAPLE
A167170 := proc(n) option remember; if n = 6 then 14; else procname(n-1)+igcd(n, procname(n-1)) ; end if; end proc: seq(A167170(i), i=6..80) ; # R. J. Mathar, Oct 30 2010
MATHEMATICA
RecurrenceTable[{a[n] == a[n - 1] + GCD[n, a[n - 1]], a[6] == 14}, a, {n, 6, 100}] (* G. C. Greubel, Jun 04 2016 *)
nxt[{n_, a_}]:={n+1, a+GCD[a, n+1]}; NestList[nxt, {6, 14}, 60][[All, 2]] (* Harvey P. Dale, Nov 03 2019 *)
PROG
(PARI) first(n)=my(v=vector(n-5)); v[1]=14; for(k=7, n, v[k-5]=v[k-6]+gcd(k, v[k-6])); v \\ Charles R Greathouse IV, Aug 22 2017
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Oct 29 2009, Nov 06 2009
EXTENSIONS
Terms > 91 from R. J. Mathar, Oct 30 2010
STATUS
approved
a(2)=3, for n>=3, a(n)=a(n-1)+gcd(n, a(n-1)).
+10
8
3, 6, 8, 9, 12, 13, 14, 15, 20, 21, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 92, 93, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116
OFFSET
2,1
COMMENTS
For every n>=3, a(n)-a(n-1) is 1 or prime. This Rowland-like "generator of primes" is different from A106108 and from generators A167168. Generalization: Let p be a prime. Let N(p-1)=p and for n>=p, N(n)=N(n-1)+gcd(n, N(n-1)). Then, for every n>=p, N(n)-N(n-1) is 1 or prime.
LINKS
E. S. Rowland, A natural prime-generating recurrence, Journal of Integer Sequences, 11 (2008), Article 08.2.8.
V. Shevelev, A new generator of primes based on the Rowland idea, arXiv:0910.4676 [math.NT], 2009.
MATHEMATICA
RecurrenceTable[{a[n] == a[n - 1] + GCD[n, a[n - 1]], a[2] == 3}, a, {n, 2, 100}] (* G. C. Greubel, Jun 05 2016 *)
KEYWORD
nonn,easy
AUTHOR
Vladimir Shevelev, Oct 30 2009, Nov 06 2009
EXTENSIONS
Edited by Charles R Greathouse IV, Nov 02 2009
STATUS
approved
Records in A167494.
+10
8
2, 3, 5, 13, 31, 61, 139, 283, 571, 1153, 2311, 4651, 9343, 19141, 38569, 77419, 154873, 310231, 621631, 1243483, 2486971, 4974721
OFFSET
1,1
COMMENTS
Conjecture: each term > 3 of the sequence is the greater member of a twin prime pair (A006512).
Indices of the records are 1, 2, 4, 6, 9, 10, 15, 18, 21, 25, 28, 30, 38, 72, 90, ... [R. J. Mathar, Nov 05 2009]
One can formulate a similar conjecture without verification of the primality of the terms (see Conjecture 4 in my paper). [Vladimir Shevelev, Nov 13 2009]
LINKS
E. S. Rowland, A natural prime-generating recurrence, Journal of Integer Sequences, Vol.11 (2008), Article 08.2.8.
E. S. Rowland, A natural prime-generating recurrence, arXiv:0710.3217 [math.NT], 2007-2008.
V. Shevelev, A new generator of primes based on the Rowland idea, arXiv:0910.4676 [math.NT], 2009.
V. Shevelev, Three theorems on twin primes, arXiv:0911.5478 [math.NT], 2009-2010. [Vladimir Shevelev, Dec 03 2009]
MATHEMATICA
nxt[{n_, a_}] := {n + 1, If[EvenQ[n], a + GCD[n+1, a], a + GCD[n-1, a]]};
A167494 = DeleteCases[Differences[Transpose[NestList[nxt, {1, 2}, 10^7]][[2]]], 1];
Tally[A167494][[All, 1]] //. {a1___, a2_, a3___, a4_, a5___} /; a4 <= a2 :> {a1, a2, a3, a5} (* Jean-François Alcover, Oct 29 2018, using Harvey P. Dale's code for A167494 *)
KEYWORD
nonn,more
AUTHOR
Vladimir Shevelev, Nov 05 2009
EXTENSIONS
Simplified the definition to include all records; one term added by R. J. Mathar, Nov 05 2009
a(16) to a(21) from R. J. Mathar, Nov 19 2009
a(22) from Jean-François Alcover, Oct 29 2018
STATUS
approved
a(6) = 7, for n >= 7, a(n) = a(n - 1) + gcd(n, a(n - 1)).
+10
6
7, 14, 16, 17, 18, 19, 20, 21, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 116, 117, 120, 121, 122, 123, 124, 125, 126, 127, 128
OFFSET
6,1
COMMENTS
For every n >= 7, a(n) - a(n - 1) is 1 or prime. This Rowland-like "generator of primes" is different from A106108 (see comment to A167168) and from A167170. Note that, lim sup a(n) / n = 2, while lim sup A106108(n) / n = lim sup A167170(n) / n = 3.
Going up to a million, differences of two consecutive terms of this sequence gives primes about 0.009% of the time. The rest are 1's. [Alonso del Arte, Nov 30 2009]
LINKS
E. S. Rowland, A natural prime-generating recurrence, Journal of Integer Sequences, 11 (2008), Article 08.2.8.
MAPLE
A[6]:= 7:
for n from 7 to 100 do A[n]:= A[n-1] + igcd(n, A[n-1]) od:
seq(A[i], i=6..100); # Robert Israel, Jun 05 2016
MATHEMATICA
a[6] = 7; a[n_ /; n > 6] := a[n] = a[n - 1] + GCD[n, a[n - 1]]; Table[a[n], {n, 6, 58}]
PROG
(Python)
from math import gcd
def aupton(nn):
alst = [7]
for n in range(7, nn+1): alst.append(alst[-1] + gcd(n, alst[-1]))
return alst
print(aupton(68)) # Michael S. Branicky, Jul 14 2021
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Oct 30 2009, Nov 06 2009
EXTENSIONS
Verified and edited by Alonso del Arte, Nov 30 2009
STATUS
approved
a(1) = 2; thereafter a(n) = a(n-1) + gcd(n, a(n-1)) if n is odd, and a(n) = a(n-1) + gcd(n-2, a(n-1)) if n is even.
+10
5
2, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 52, 53, 54, 55, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 124, 125, 126
OFFSET
1,1
COMMENTS
Conjectures. 1) For n >= 2, every difference a(n) - a(n-1) is 1 or prime; 2) Every record of differences a(n) - a(n-1) greater than 3 belongs to the sequence of the greater of twin primes (A006512).
Conjecture #1 above fails at n = 620757, with a(n) = 1241487 and a(n-1) = 1241460, difference = 27. Additionally, the terms of related A167495(m) quickly tend to index n/2. So for example, A167495(14) = 19141 is seen at n = 38284. - Bill McEachen, Jan 20 2023
It seems that, for n > 4, (3*n-3)/2 <= a(n) <= 2n - 3. Can anyone find a proof or disproof? - Charles R Greathouse IV, Jan 22 2023
LINKS
E. S. Rowland, A natural prime-generating recurrence, Journal of Integer Sequences, Vol.11 (2008), Article 08.2.8.
Vladimir Shevelev, A new generator of primes based on the Rowland idea, arXiv:0910.4676 [math.NT], 2009.
Vladimir Shevelev, Three theorems on twin primes, arXiv:0911.5478 [math.NT], 2009-2010.
FORMULA
For n > 3, n < a(n) < n*(n-1)/2. - Charles R Greathouse IV, Jan 22 2023
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[EvenQ[n], a+GCD[n+1, a], a+GCD[n-1, a]]}; Transpose[ NestList[nxt, {1, 2}, 70]][[2]] (* Harvey P. Dale, Dec 05 2015 *)
PROG
(PARI) lista(nn)=my(va = vector(nn)); va[1] = 2; for (n=2, nn, va[n] = if (n%2, va[n-1] + gcd(n, va[n-1]), va[n-1] + gcd(n-2, va[n-1])); ); va; \\ Michel Marcus, Dec 13 2018
(Python)
from math import gcd
from itertools import count, islice
def agen(): # generator of terms
an = 2
for n in count(2):
yield an
an = an + gcd(n, an) if n&1 else an + gcd(n-2, an)
print(list(islice(agen(), 66))) # Michael S. Branicky, Jan 22 2023
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Nov 05 2009
EXTENSIONS
More terms from Harvey P. Dale, Dec 05 2015
STATUS
approved
List of first differences of A167493 that are different from 1.
+10
5
2, 3, 3, 5, 3, 13, 5, 3, 31, 61, 7, 5, 3, 7, 139, 5, 3, 283, 5, 3, 571, 7, 5, 3, 1153, 5, 3, 2311, 31, 4651, 17, 5, 13, 3, 3, 5, 3, 9343, 5, 3, 11, 3, 59, 3, 29, 3, 19, 7, 5, 3, 7, 19, 5, 3, 17, 3, 113
OFFSET
1,1
COMMENTS
Conjecture. All terms of the sequence are primes.
The conjecture is false: a(144)=27, a(146)=25, a(158)=45, etc., which are composite numbers. - Harvey P. Dale, Dec 05 2015
LINKS
E. S. Rowland, A natural prime-generating recurrence, Journal of Integer Sequences, Vol. 11 (2008), Article 08.2.8.
V. Shevelev, A new generator of primes based on the Rowland idea, arXiv:0910.4676 [math.NT], 2009.
V. Shevelev, Three theorems on twin primes, arXiv:0911.5478 [math.NT], 2009-2010. [From Vladimir Shevelev, Dec 03 2009]
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[EvenQ[n], a+GCD[n+1, a], a+GCD[n-1, a]]}; DeleteCases[ Differences[ Transpose[NestList[nxt, {1, 2}, 20000]][[2]]], 1] (* Harvey P. Dale, Dec 05 2015 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 2; for (n=2, nn, va[n] = if (n%2, va[n-1] + gcd(n, va[n-1]), va[n-1] + gcd(n-2, va[n-1])); ); select(x->(x!=1), vector(nn-1, n, va[n+1] - va[n])); } \\ Michel Marcus, Dec 13 2018
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Nov 05 2009
STATUS
approved

Search completed in 0.011 seconds