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.

Previous Showing 11-20 of 33 results. Next

A118534 a(n) is the largest k such that prime(n+1) = prime(n) + (prime(n) mod k), or 0 if no such k exists.

Original entry on oeis.org

0, 0, 3, 0, 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

Rémi Eismann, Apr 18 2006, Feb 14 2008

Keywords

Comments

a(n) = prime(n) - g(n) or A000040(n) - A001223(n) if prime(n) - g(n) > g(n), 0 otherwise.
a(n) = 0 only for primes 2, 3 and 7.
Under the twin prime conjecture prime(n+1)-prime(n) = 2 infinitely often, and from that we can conclude that k=prime(n)-2 infinitely often. [Roderick MacPhee, Jul 24 2012]
a(n) = A062234(n) for 5 <= n <= 1000. - Georg Fischer, Oct 28 2018

Examples

			n=5: prime(5) = 11, prime(6) = 13, 13 = 11 + (11 mod 3) = 11 + (11 mod 9), so A117078(5) = 3, a(5) = 9 and A117563(5) = 9/3 = 3. Thus 11 has level 3 and so is a member of A117873.
		

Crossrefs

Cf. A062234, A117078; essentially the same as A117563.

Programs

  • Mathematica
    a[n_] := If[n == 1 || n == 2 || n == 4, 0, 2Prime[n] - Prime[n + 1]]; Array[a, 62] (* Robert G. Wilson v, May 09 2006 *)

Extensions

Edited by N. J. A. Sloane, May 07 2006
More terms from Robert G. Wilson v, May 09 2006

A252750 a(n) = A003961(A005940(n+1)) - 2 * A005940(n+1).

Original entry on oeis.org

-1, -1, -1, 1, -3, 3, 7, 11, -3, 1, 5, 21, -1, 39, 71, 49, -9, 5, 13, 23, 7, 45, 85, 87, 23, 47, 95, 153, 93, 267, 463, 179, -9, -5, -1, 43, -19, 81, 149, 109, -11, 91, 175, 195, 189, 345, 605, 309, -73, 167, 311, 241, 357, 435, 775, 531, 645, 529, 965, 909, 1151, 1551, 2639, 601, -15, -1, 7, 29, -11, 63, 127, 185, 5, 53, 125, 327, 87, 573, 997, 407, -65, 121, 253, 413, 231
Offset: 0

Views

Author

Antti Karttunen, Dec 21 2014

Keywords

Comments

From Antti Karttunen, May 21 2024: (Start)
Like A005940 itself, also this irregular table derived from it can be represented as a binary tree:
-1
|
................. -1 ..................
-1 1
-3 ......./ \....... 3 7 ......./ \....... 11
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
-3 1 5 21 -1 39 71 49
-9 5 13 23 7 45 85 87 23 47 95 153 93 267 463 179
etc.
(End)

Crossrefs

Cf. A252743 (characteristic function for positive terms), A252751 (partial sums of sequence b(0) = 0, b(n) = a(n), for n>0).
Cf. A062234 (when negated forms the left edge apart from the initial term), A003063 (right edge).
Cf. also A372562 (apart from the initial term, same data in square array).

Programs

Formula

a(n) = A003961(A005940(n+1)) - 2 * A005940(n+1).
a(n) = A252748(A005940(n+1)).
Other identities. For all n >= 1:
sgn(a(n)) = (-1)^(1+A252743(n)).

Extensions

Term a(0) = -1 prepended by Antti Karttunen, May 21 2024

A372562 Square array A(n, k) = A246278(1+n, k) - 2*A246278(n, k), read by falling antidiagonals, where A246278 is the prime shift array.

Original entry on oeis.org

-1, 1, -1, 3, 7, -3, 11, 5, -1, -3, 1, 71, 7, 23, -9, 21, 13, 93, -11, -73, -9, 5, 85, -19, 645, -65, -49, -15, 49, -1, 189, 5, -465, -119, -217, -15, 39, 463, -11, 495, -127, 519, -209, -193, -17, 23, 95, 1151, -29, -273, -103, -2967, -207, -217, -27, -5, 149, 357, 9839, -119, -255, -231, -1551, -435, -721, -25
Offset: 1

Views

Author

Antti Karttunen, May 21 2024

Keywords

Comments

For all k >= 1, A(1+A336836(2*k), k) < 0, and it is the topmost negative number of the column k.
In those columns k where 2k is in A104210, 6, 12, 18, 24, ..., there is present a "prime thread" of successive primes (see the example).

Examples

			The top left corner of the array:
k=    1     2     3      4     5      6     7       8      9     10    11      12
2k=   2     4     6      8    10     12    14      16     18     20    22      24
--+-------------------------------------------------------------------------------
1 |  -1,    1,    3,    11,    1,    21,    5,     49,    39,    23,   -5,     87,
2 |  -1,    7,    5,    71,   13,    85,   -1,    463,    95,   149,    7,    605,
3 |  -3,   -1,    7,    93,  -19,   189,  -11,   1151,   357,    87,  -37,   2023,
4 |  -3,   23,  -11,   645,    5,   495,  -29,   9839,   165,   783,  -13,   9757,
5 |  -9,  -73,  -65,  -465, -127,  -273, -119,   -721,    39,  -903, -129,   2743,
6 |  -9,  -49, -119,   519, -103,  -255, -105,  26399, -1377,   225, -227,  18649,
7 | -15, -217, -209, -2967, -231, -2679, -397, -36721, -2223, -2825, -351, -28937,
...
Terms of column 9: 39 (3*13), 95 (5*19), 357 (3*7*17), 165 (3*5*11), 39 (3*13), -1377 (- 3^4 * 17), -2223 (- 3^2 * 13 * 19), ..., show an ascending "prime thread" (3, 5, 7, 11, 13, 17, 19, ...) that is mentioned in comments.
		

Crossrefs

Cf. A062234 (column 1 when values are negated).
Cf. also A252750 (same terms in irregular triangle), A372563.
See also conjecture 1 in A349753.

Programs

  • PARI
    up_to = 66;
    A246278sq(row,col) = if(1==row,2*col, my(f = factor(2*col)); for(i=1, #f~, f[i,1] = prime(primepi(f[i,1])+(row-1))); factorback(f));
    A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    A252748(n) = (A003961(n) - (2*n));
    A372562sq(row,col) = A252748(A246278sq(row,col));
    A372562list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A372562sq(col,(a-(col-1))))); (v); };
    v372562 = A372562list(up_to);
    A372562(n) = v372562[n];

Formula

A(n,k) = A252748(A246278(n,k)).

A064819 a(n) = p(1)*p(2)*...*p(n) - p(n+1)^2, where p(i) = i-th prime.

Original entry on oeis.org

-7, -19, -19, 89, 2141, 29741, 510149, 9699161, 223092029, 6469692269, 200560488761, 7420738133129, 304250263525361, 13082761331667821, 614889782588488601, 32589158477190041249, 1922760350154212635349, 117288381359406970978781
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2001

Keywords

Comments

It is known that a(n) > 0 for n >= 4.

References

  • R. Honsberger, Mathematical Diamonds, MAA, 2003, see p. 79. [Added by N. J. A. Sloane, Jul 05 2009]
  • H. Rademacher & O. Toeplitz, The Enjoyment of Mathematics, pp. 187-192 Dover NY 1990.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939.

Crossrefs

Programs

  • Mathematica
    FoldList[Times, Most[#]] - Rest[#]^2 & [Prime[Range[25]]] (* Paolo Xausa, Nov 06 2024 *)
  • PARI
    { p=1; for (n=1, 100, p*=prime(n); write("b064819.txt", n, " ", p - prime(n + 1)^2) ) } \\ Harry J. Smith, Sep 27 2009
    
  • PARI
    a(n) = prod(k=1, n, prime(k)) - prime(n+1)^2; \\ Michel Marcus, Jun 19 2018
    
  • Python
    from sympy import prime, primorial
    def A064819(n): return primorial(n)-prime(n+1)**2 # Chai Wah Wu, Feb 24 2023

A210497 a(n) = 2*prime(n+1) - prime(n).

Original entry on oeis.org

4, 7, 9, 15, 15, 21, 21, 27, 35, 33, 43, 45, 45, 51, 59, 65, 63, 73, 75, 75, 85, 87, 95, 105, 105, 105, 111, 111, 117, 141, 135, 143, 141, 159, 153, 163, 169, 171, 179, 185, 183, 201, 195, 201, 201, 223, 235, 231, 231, 237, 245, 243, 261, 263, 269, 275, 273, 283
Offset: 1

Views

Author

Marco Piazzalunga, Jan 24 2013

Keywords

Comments

The subsequence of multiples of 3 begins: 9, 15, 15, 21, 21, 27, 33, 45.
The subsequence of primes begins: 7, 43, 73, 163, 179, 223.
Some terms, like a(3)=15 or a(5)=21, are repeated twice, other terms, like a(23)=105, are repeated three times.

Examples

			a(2) = 7 because prime(3) = 5, prime(2) = 3, and 2 * 5 - 3 = 7.
a(3) = 9 because prime(4) = 7, prime(3) = 5, and 2 * 7 - 5 = 9.
a(4) = 15 because prime(5) = 11, prime(4) = 7, and 2 * 11 - 7 = 15.
		

Crossrefs

Cf. A001223, A062234, A085704 (subsequence).

Programs

  • Magma
    [2*NextPrime(p)-p: p in PrimesUpTo(300)]; // Bruno Berselli, Jan 24 2013
    
  • Mathematica
    Table[2 Prime[n + 1] - Prime[n], {n, 50}] (* Vincenzo Librandi, May 03 2015 *)
    ListConvolve[{2, -1}, Prime[Range[100]]] (* Paolo Xausa, Oct 29 2024 *)
  • PARI
    a(n)=my(p=prime(n));2*nextprime(p+1)-p \\ Charles R Greathouse IV, Jan 24 2013
    
  • Python
    from sympy import prime, nextprime
    def A210497(n): return -(p:=prime(n))+(nextprime(p)<<1) # Chai Wah Wu, Oct 29 2024

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Jan 24 2013

A098764 a(n) = 3p - q where p and q are consecutive primes.

Original entry on oeis.org

3, 4, 8, 10, 20, 22, 32, 34, 40, 56, 56, 70, 80, 82, 88, 100, 116, 116, 130, 140, 140, 154, 160, 170, 190, 200, 202, 212, 214, 212, 250, 256, 272, 268, 296, 296, 308, 322, 328, 340, 356, 352, 380, 382, 392, 386, 410, 442, 452, 454, 460, 476, 472, 496, 508, 520
Offset: 1

Views

Author

Giovanni Teofilatto, Sep 30 2004

Keywords

Comments

Except for the initial term, a(n)=={2, 4} mod 6.
Not monotonic: a(29) = 214 > 212 = a(30), a(33) = 272 > 268 = a(34), etc. - Charles R Greathouse IV, Jun 03 2013

Crossrefs

Programs

  • Mathematica
    ListConvolve[{-1,3},Prime[Range[100]]] (* Paolo Xausa, Nov 02 2023 *)
  • PARI
    a(n) = 3*prime(n) - prime(n+1) \\ Michel Marcus, Jun 03 2013

Formula

a(n) = A001043(n) - 2*A001223(n).
a(n) = 3*A000040(n)-A000040(n+1) = A001748(n)-A000040(n+1) = A001747(n+1)-A001223(n). - R. J. Mathar, Apr 22 2010
a(n) ~ 2n log n. - Charles R Greathouse IV, Jun 03 2013
a(n) = A100021(n) + 3. - Hugo Pfoertner, Nov 02 2023
a(n) = A062234(n) + A000040(n). - Anthony S. Wright, Feb 19 2024

Extensions

Corrected (116 duplicated) by R. J. Mathar, Apr 22 2010

A111209 Difference between the powers of two and the primes.

Original entry on oeis.org

0, 1, 3, 9, 21, 51, 111, 237, 489, 995, 2017, 4059, 8151, 16341, 32721, 65483, 131013, 262083, 524221, 1048505, 2097079, 4194225, 8388525, 16777127, 33554335, 67108763, 134217625, 268435349, 536870803, 1073741711, 2147483521, 4294967165, 8589934455, 17179869045
Offset: 1

Views

Author

Roger L. Bagula, Oct 25 2005

Keywords

Comments

2*a(n) < a(n+1) because 2*prime(n) > prime(n+1) (see A062234). We have a(n) - a(1) < a(n+1) - a(n) so this is a B_2 sequence. - Thomas Ordowski, Sep 23 2014

Crossrefs

Programs

Formula

a(n) = 2^n - prime(n).
a(n) = A000079(n) - A000040(n). - Wesley Ivan Hurt, Sep 23 2014

Extensions

More terms from Michel Marcus, Sep 23 2014

A225907 Smallest n-Ramanujan prime that is less than half of the next n-Ramanujan prime, or 0 if none exists.

Original entry on oeis.org

0, 2, 11, 41, 587, 14143
Offset: 0

Views

Author

Jonathan Sondow, Jun 08 2013

Keywords

Comments

In A192824 Noe defines 0-Ramanujan primes to be simply primes, and 1-Ramanujan primes to be Ramanujan primes. Define the k-th 2-Ramanujan prime to be the smallest number R'_k (the notation in Paksoy 2012) with the property that the interval (x/2,x] contains at least k 1-Ramanujan primes, for any x >= R'_k. Continuing inductively, define n-Ramanujan primes in terms of (n-1)-Ramanujan primes.
Only the first three terms 0, 2, 11 are proved (by Chebyshev, Ramanujan, and Paksoy, respectively). The rest are conjectural--see the 2nd comment in A192821.
See A104272 for additional comments, references, links, and cross-refs.
Is it true that for every n there exists K = K(n) such that for all k > K, the k-th n-Ramanujan prime is greater than half of the (k+1)-th n-Ramanujan prime? (Equivalently, is there a largest n-Ramanujan prime that is less than half of the next n-Ramanujan prime?) It is true for n = 0 by Bertrand's Postulate (see A062234), and for n = 1 by a theorem of Paksoy. Is it even true that if n is fixed, then (k-th n-Ramanujan prime) ~ ((k+1)-th n-Ramanujan prime) as k -> infinity? - Jonathan Sondow, Dec 16 2013

Examples

			By Bertrand's Postulate (proved by Chebyshev), prime(k+1) < 2*prime(k) for all k, so a(0) = 0.
Ramanujan proved that the Ramanujan primes begin 2, 11, ..., so a(1) = 2.
Paksoy proved that the 2-Ramanujan primes begin 11, 41,..., so a(2) = 11.
It appears that the 3-Ramanujan primes begin 41, 149, ...; if true, then a(3) = 41.
It appears that the 4-Ramanujan primes begin 569, 571, 587, 1367 ...; if true, then a(4) = 587.
		

Crossrefs

Cf. A000040 (0-Ramanujan primes), A104272 (1-Ramanujan primes), A192820 (2-Ramanujan primes), A192821 (3-Ramanujan primes), A192822 (4-Ramanujan primes), A192823 (5-Ramanujan primes), A192824 (least n-Ramanujan prime). Cf. also A233822 = 2*R(n) - R(n+1) and A062234.

A233822 a(n) = 2*R(n) - R(n+1), where R(n) is the n-th Ramanujan prime.

Original entry on oeis.org

-7, 5, 5, 17, 35, 35, 51, 63, 45, 93, 95, 87, 105, 147, 135, 155, 177, 135, 225, 225, 227, 237, 219, 257, 257, 255, 303, 275, 345, 331, 361, 345, 393, 399, 407, 429, 427, 417, 435, 483, 479, 437, 567, 555, 581, 587, 597, 595, 573, 639, 639, 641, 647
Offset: 1

Views

Author

Jonathan Sondow, Dec 16 2013

Keywords

Comments

a(n) = 2*A104272(n) - A104272(n+1).
Paksoy proved that a(n) > 0 for n > 1.
Paksoy's theorem is the analog for Ramanujan primes of Chebychev's theorem (Bertrand's postulate) that 2*prime(n) - prime(n+1) > 0 for n > 0 (see A062234).

Examples

			The only negative term is a(1) = 2*R(1) - R(2) = 2*2 - 11 = -7.
		

Crossrefs

Programs

A346476 a(n) = 2*n - A250469(n).

Original entry on oeis.org

1, 1, 1, -1, 3, -3, 3, -5, -7, -7, 9, -9, 9, -11, -5, -13, 15, -15, 15, -17, -13, -19, 17, -21, 1, -23, -11, -25, 27, -27, 25, -29, -19, -31, -7, -33, 33, -35, -17, -37, 39, -39, 39, -41, -25, -43, 41, -45, -23, -47, -23, -49, 47, -51, 19, -53, -31, -55, 57, -57, 55, -59, -29, -61, 11, -63, 63, -65, -37
Offset: 1

Views

Author

Antti Karttunen, Jul 29 2021

Keywords

Crossrefs

Programs

Formula

a(n) = A280692(n) - A252748(n).
a(n) = A033879(n) - A346473(n).
a(n) = A346478(n) - A346477(n).
a(n) = n - A347378(n).
a(A000040(n)) = -A252748(A000040(n)) = -A346477(A000040(n)) = A062234(n).
Previous Showing 11-20 of 33 results. Next