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.

A062234 From Bertrand's postulate: a(n) = 2*prime(n) - prime(n+1).

Original entry on oeis.org

1, 1, 3, 3, 9, 9, 15, 15, 17, 27, 25, 33, 39, 39, 41, 47, 57, 55, 63, 69, 67, 75, 77, 81, 93, 99, 99, 105, 105, 99, 123, 125, 135, 129, 147, 145, 151, 159, 161, 167, 177, 171, 189, 189, 195, 187, 199, 219, 225, 225, 227, 237, 231, 245, 251, 257, 267, 265, 273, 279
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 29 2001

Keywords

Comments

The theorem that a(n) > 0 for all n is known as "Bertrand's Postulate", and was proved by Tchebycheff in 1852.
The analog for Ramanujan primes is Paksoy's theorem that 2*R(n) - R(n+1) > 0 for n > 1. See A233822. - Jonathan Sondow, Dec 16 2013

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939.

Crossrefs

Cf. A000040, A001223, A215808 (prime terms), A233822.
When negated, forms the left edge of irregular triangle A252750, and also the leftmost column of square array A372562.

Programs

  • Haskell
    a062234 n = a062234_list !! (n-1)
    a062234_list = zipWith (-) (map (* 2) a000040_list) (tail a000040_list)
    -- Reinhard Zumkeller, May 31 2015
  • Maple
    a:= n-> (p-> 2*p(n)-p(n+1))(ithprime):
    seq(a(n), n=1..60);  # Alois P. Heinz, Feb 09 2022
  • Mathematica
    Table[2*Prime[n]-Prime[n+1],{n,60}] (* James C. McMahon, Apr 27 2024 *)
    2#[[1]]-#[[2]]&/@Partition[Prime[Range[70]],2,1] (* Harvey P. Dale, Jul 29 2024 *)
    ListConvolve[{-1, 2}, Prime[Range[100]]] (* Paolo Xausa, Nov 02 2024 *)
  • PARI
    a(n) = 2*prime(n) - prime(n + 1); \\ Harry J. Smith, Aug 03 2009
    

Formula

a(n) = A000040(n) - A001223(n). - Zak Seidov, Sep 07 2012
a(n) = 2*A000040(n) - A000040(n+1). - Zak Seidov, May 12 2020
a(n) = A098764(n) - A000040(n). - Anthony S. Wright, Feb 19 2024

Extensions

Edited by N. J. A. Sloane, Feb 24 2023

A257951 Numbers n with property that A062234(n)=A062234(n+1)=A062234(n+2)=A062234(n+3)=A062234(n+4).

Original entry on oeis.org

465460, 672832, 829363, 891802, 919088, 1703659, 2656715, 2669971, 3035410, 3223041, 3585960, 3608292, 3636024, 4047253, 4058989, 4232549, 4591286, 4785400, 4797700, 5054313, 5120280, 5599321, 5872369, 6089675, 6541163, 6963642, 7957852, 8234393, 9069087, 9082140, 9312431
Offset: 1

Views

Author

Zak Seidov, May 14 2015

Keywords

Comments

a(n) = A258432(m), where m such that A258383(m) = 5. - Reinhard Zumkeller, May 31 2015

Examples

			For k=465460..465464, 2*prime(k)-prime(k+1)=6824895.
a(1) = A258437(A258432(5)) = 465460.
		

Crossrefs

Programs

  • Haskell
    a257951 n = a257951_list !! (n-1)
    a257951_list = map a258432 $ filter ((== 5) . a258383) [1..]
    -- Reinhard Zumkeller, May 31 2015

Extensions

More terms from Zak Seidov, Jul 29 2015

A257892 Numbers n with property that A062234(n) = A062234(n+1) = A062234(n+2) = A062234(n+3).

Original entry on oeis.org

332, 878, 1999, 3949, 4524, 5953, 6576, 8676, 10068, 11840, 17107, 17208, 19034, 19525, 46771, 46828, 52767, 54567, 54927, 56879, 58695, 61748, 65926, 77168, 77676, 79722, 92775, 92823, 96099, 101607, 111007, 136141, 160095, 160418, 173404
Offset: 1

Views

Author

Zak Seidov, May 14 2015

Keywords

Comments

a(n) = A258432(m), where m such that A258383(m) = 4. - Reinhard Zumkeller, May 31 2015

Examples

			a(1) = A258437(A258432(4)) = 332. - _Reinhard Zumkeller_, May 31 2015
		

Crossrefs

Programs

A258437 Smallest number m such that A062234(m) = A062234(m-1+k) for k = 1..n.

Original entry on oeis.org

9, 1, 302, 332, 465460, 67928439
Offset: 1

Views

Author

Reinhard Zumkeller, May 31 2015

Keywords

Comments

From Michel Marcus, Feb 09 2022: (Start)
Previous name: "Smallest number m such that A258383(m) = n" was not ok. For instance, for a(1) the smallest m such that A258383(m)=1 is 5, then we have to sum up the first 5 terms 2+2+2+2+1 to get 9, as shown in the example table (whose 2nd and 3rd column names I edited too).
Note that prime([302, 332, 465460]) = [1997, 2237, 6824897] which is a subsequence of A090807. Then one can verify that primepi(1356705137 = A090807(7)) = 67928439 and primepi(3637803390827 = A090807(8)) = 130463972798 are good candidates for a(6) and a(7). a(6) has been confirmed by program. (End)

Examples

			   n |   f(n) | a(n) = A258432(f(n)) |     Run in A062234
  ---+--------+----------------------+--------------------------
   1 |      5 |       9 = A258469(1) | [17]
   2 |      1 |       1 = A257762(1) | [1, 1]
   3 |    265 |     302 = A258449(1) | [1995, 1995, 1995]
   4 |    290 |     332 = A257892(1) | [2235, 2235, 2235, 2235]
   5 | 440676 |  465460 = A257951(1) | [ ___ 5 x 6824895 ___ ]
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a258437 = (+ 1) . fromJust . (`elemIndex` a258383_list)
    
  • PARI
    f(n) = 2*prime(n) - prime(n+1); \\ A062234
    lista(nn) = {my(vp=primes(nn)); my(v=vector(nn-1, k, 2*vp[k] - vp[k+1]), last=v[1], nb=1, list=List()); kill(vp); for (n=2, nn-1, if (v[n]==last, nb++, listput(list, nb); last=v[n]; nb=1);); Vec(list);} \\ A258383
    find(k, v) = {my(i=1); while (v[i] != k, i++); i;}
    listr(nn) = {my(v=lista(nn)); for (k=1, 6, my(pos = find(k, v)); print1(sum(i=1, pos, v[i])- k + 1, ", "););}
    listr(9*10^7) \\ Michel Marcus, Feb 09 2022

Formula

A258383(a(n)) = n and A258383(m) != n for m < a(n);
let m = A258432(a(n)): A062234(m) = A062234(m-1+k) for k = 1..n.

Extensions

New name and a(6) from Michel Marcus, Feb 09 2022

A258449 Numbers n such that A062234(n) = A062234(n+1) = A062234(n+2).

Original entry on oeis.org

302, 336, 384, 805, 1016, 1043, 1963, 2201, 2364, 2398, 2495, 2506, 2528, 2574, 2683, 2734, 3208, 4267, 4561, 4659, 5234, 5415, 5525, 5620, 5759, 5903, 6044, 6258, 6543, 7737, 7928, 8019, 8039, 8115, 8521, 8717, 8833, 9056, 9165, 9379, 9730, 10302, 10495
Offset: 1

Views

Author

Reinhard Zumkeller, May 31 2015

Keywords

Comments

a(n) = A258432(m), where m such that A258383(m) = 3.

Examples

			a(1) = A258437(A258432(3)) = 302.
		

Crossrefs

Programs

  • Haskell
    a258449 n = a258449_list !! (n-1)
    a258449_list = map a258432 $ filter ((== 3) . a258383) [1..]

A258469 Numbers m such that A062234(m) != A062234(m+1).

Original entry on oeis.org

9, 10, 11, 12, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 47, 48, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 91
Offset: 1

Views

Author

Reinhard Zumkeller, May 31 2015

Keywords

Comments

a(n) = A258432(m), where m such that A258383(m) = 1.

Examples

			a(1) = A258437(A258432(1)) = 9.
		

Crossrefs

Programs

  • Haskell
    a258469 n = a258469_list !! (n-1)
    a258469_list = map a258432 $ filter ((== 1) . a258383) [1..]

A303112 Primes p such that (r-q)/(q-p) = 2 or 1/2, and p < q < r are three consecutive primes.

Original entry on oeis.org

2, 5, 7, 11, 13, 17, 37, 41, 67, 89, 97, 101, 103, 107, 191, 193, 223, 227, 277, 307, 311, 347, 389, 397, 449, 457, 461, 479, 487, 491, 503, 613, 641, 739, 757, 761, 821, 823, 853, 857, 877, 881, 907, 929, 991, 1087, 1091, 1231, 1277, 1297, 1301, 1423, 1427, 1439, 1447, 1453
Offset: 1

Views

Author

Andres Cicuttin, Apr 18 2018

Keywords

Comments

Conjecture: The two most frequent ratios between consecutive prime gaps are 2 and 1/2, and both ratios occur with about the same frequency.

Examples

			The first three consecutive primes are 2, 3 and 5, and (5-3)/(3-2)=2, so the first term is a(1)=2, that is, the first prime of (2,3,5).
The next three consecutive primes are 3, 5 and 7, and (7-5)/(5-3)=1, so the first prime of (3,5,7) is not in the list.
The next three consecutive primes are 5, 7 and 11, and (11-7)/(7-5)=2, so the second term is a(2)=5, that is, the first prime of (5,7,11).
The prime 13 is also in the list because (19-17)/(17-13)=1/2.
		

Crossrefs

Cf. A257762 (indices of primes with above ratio = 2).

Programs

  • Mathematica
    b={};
    Do[If[Abs[Log[2,(Prime[j+2]-Prime[j+1])/(Prime[j+1]-Prime[j])]]==1,AppendTo[b,Prime[j]]],{j,1,200}];
    Print@b
    Select[Partition[Prime[Range[250]],3,1],(#[[3]]-#[[2]])/(#[[2]]-#[[1]]) == 2||(#[[3]]-#[[2]])/(#[[2]]-#[[1]])==1/2&][[All,1]] (* Harvey P. Dale, Mar 14 2022 *)
  • PARI
    isok(p) = my(q = nextprime(p+1), r = nextprime(q+1), f = (r-q)/(q-p)); (f == 2) || (f == 1/2);
    forprime(p=2, 1000, if (isok(p), print1(p, ", "))); \\ Michel Marcus, Apr 23 2018

Formula

Conjecture: lim_{n->inf} n/primepi(a(n)) > k > 0 for some k.
Showing 1-7 of 7 results.