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 13 results. Next

A234851 Indices of primes in A014692, i.e., numbers k such that prime(k)-k+1 is prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 13, 17, 21, 23, 25, 31, 41, 43, 49, 61, 71, 77, 83, 89, 103, 105, 109, 121, 129, 133, 139, 151, 161, 173, 181, 183, 185, 189, 199, 211, 213, 223, 231, 235, 241, 243, 247, 265, 271, 273, 277, 279, 281, 285, 293, 301, 303, 307, 311, 317
Offset: 1

Views

Author

M. F. Hasler, Dec 31 2013

Keywords

Comments

Sequence A234695 lists primes in this sequence.

Crossrefs

Programs

  • Maple
    select(k -> isprime(ithprime(k)-k+1), [$1..1000]); # Robert Israel, Feb 19 2021
  • PARI
    for(k=1,999,isprime(prime(k)-k+1)&&print1(k","))
    
  • PARI
    is_A234851(n)=isprime(prime(k)-k+1)

Formula

a(n) = PrimePi(A234850(n)), PrimePi = A000720.

A234850 Primes in A014692, i.e., of the form prime(k)-k+1, for some k.

Original entry on oeis.org

2, 2, 3, 7, 11, 29, 43, 53, 61, 73, 97, 139, 149, 179, 223, 283, 313, 349, 373, 461, 467, 491, 541, 599, 619, 659, 727, 787, 859, 907, 911, 919, 941, 1019, 1087, 1091, 1187, 1223, 1249, 1283, 1301, 1321, 1433, 1471, 1481, 1511, 1523, 1543
Offset: 1

Views

Author

M. F. Hasler, Dec 31 2013

Keywords

Comments

The first term is listed twice because A014692(1) = 2-1+1 = A014692(2) = 3-2+1 = 2 both are prime; thereafter the sequence A014692 is strictly increasing, so there is no other duplicate value.

Crossrefs

Cf. A234695.

Programs

  • PARI
    for(k=1,999,isprime(p=prime(k)-k+1)&&print1(p","))

Formula

a(n) = prime(A234851(n)), prime = A000040.

A086969 Duplicate of A014692.

Original entry on oeis.org

2, 2, 3, 4, 7, 8, 11, 12, 15, 20, 21, 26, 29, 30, 33, 38, 43, 44, 49, 52, 53, 58, 61, 66, 73
Offset: 1

Views

Author

Keywords

A014689 a(n) = prime(n)-n, the number of nonprimes less than prime(n).

Original entry on oeis.org

1, 1, 2, 3, 6, 7, 10, 11, 14, 19, 20, 25, 28, 29, 32, 37, 42, 43, 48, 51, 52, 57, 60, 65, 72, 75, 76, 79, 80, 83, 96, 99, 104, 105, 114, 115, 120, 125, 128, 133, 138, 139, 148, 149, 152, 153, 164, 175, 178, 179, 182, 187, 188, 197, 202, 207, 212, 213, 218, 221, 222
Offset: 1

Views

Author

Keywords

Comments

a(n) = A048864(A000040(n)) = number of nonprimes in RRS of n-th prime. - Labos Elemer, Oct 10 2002
A000040 - A014689 = A000027; in other words, the sequence of natural numbers subtracted from the prime sequence produces A014689. - Enoch Haga, May 25 2009
a(n) = A000040(n) - n. a(n) = inverse (frequency distribution) sequence of A073425(n), i.e., number of terms of sequence A073425(n) less than n. a(n) = A065890(n) + 1, for n >= 1. a(n) - 1 = A065890(n) = the number of composite numbers, i.e., (A002808) less than n-th primes, (i.e., < A000040(n)). - Jaroslav Krizek, Jun 27 2009
a(n) = A162177(n+1) + 1, for n >= 1. a(n) - 1 = A162177(n+1) = the number of composite numbers, i.e., (A002808) less than (n+1)-th number of set {1, primes}, (i.e., < A008578(n+1)). - Jaroslav Krizek, Jun 28 2009
Conjecture: Each residue class contains infinitely many terms of this sequence. Similarly, for any integers m > 0 and r, we have prime(n) + n == r (mod m) for infinitely many positive integers n. - Zhi-Wei Sun, Nov 25 2013
First differences are A046933 = differences minus one between successive primes. - Gus Wiseman, Jan 18 2020

Crossrefs

Equals A014692 - 1.
The sum of prime factors of n is A001414(n).
The sum of prime indices of n is A056239(n).
Their difference is A331415(n).

Programs

Formula

G.f: b(x) - x/((1-x)^2), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 13 2016

Extensions

More terms from Vasiliy Danilov (danilovv(AT)usa.net), Jul 1998
Correction for Aug 2009 change of offset in A158611 and A008578 by Jaroslav Krizek, Jan 27 2010

A040976 a(n) = prime(n) - 2.

Original entry on oeis.org

0, 1, 3, 5, 9, 11, 15, 17, 21, 27, 29, 35, 39, 41, 45, 51, 57, 59, 65, 69, 71, 77, 81, 87, 95, 99, 101, 105, 107, 111, 125, 129, 135, 137, 147, 149, 155, 161, 165, 171, 177, 179, 189, 191, 195, 197, 209, 221, 225, 227, 231, 237, 239, 249, 255, 261
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that k! reduced mod (k+2) is 1. - Benoit Cloitre, Mar 11 2002
The first a(n) numbers starting from 2 are divisible by primes up to prime(n-1). - Lekraj Beedassy, Jun 21 2006
The terms in this sequence are the cumulative sums of distances from one prime to another. For example for the distance from the first to 26th prime, 2 to 101, the cumulative sum of distances is 99, always the last prime, here 101, minus 2. - Enoch Haga, Apr 24 2006
The primes in this sequence are the initial primes of twin prime pairs. - Sebastiao Antonio da Silva, Dec 21 2008
Note that many, but not all, of these numbers satisfy x such that x^(x+1) = 1 mod (x+2). The first exception is 339. - Thomas Ordowski, Nov 27 2013
If this sequence had an infinite number of primes, the twin prime conjecture would follow. Sequence holds all primes in A001359. - John W. Nicholson, Apr 14 2014
From Bernard Schott, Feb 19 2023: (Start)
Equivalently, except for a(1)=0, all terms are odd integers d such that the longest possible arithmetic progression (AP) of primes with common difference d has only two elements.
For each term d, there exists only one such AP of primes, and this one always starts with A342309(d) = 2, so this unique AP is (2, 2+d) = (2, prime(m)) with m > 1; so, first examples are (2,3), (2,5), (2,7), (2,11), ... next elements should be respectively: 4, 8, 12, 20, ... that are all composite numbers.
Similar sequence with even common differences d is A360735.
This subsequence of A359408 corresponds to the first case: '2 is prime'; second case corresponding to the even common differences d is A360735. (End)

Examples

			a(13) = 39, because A000040(13) = 41.
		

Crossrefs

Equals A359408 \ A360735.
First column of A086800, and of A379011, last diagonal of A090321, and of A162621.
See also irregular triangles A103728, A319148, A369497.

Programs

Formula

a(n) = A000040(n) - 2 = Sum_{i=1..n-1} A001223(i).
For n > 2: A092953(a(n)) = 1. - Reinhard Zumkeller, Nov 10 2012
If m is a term then A123556(m) = 2, but the converse is false: a counterexample is A123556(16) = 2 and 16 is not a term. - Bernard Schott, Feb 19 2023
a(n) = Sum_{k = 2..floor(2n*log(n)+2)} (1-floor(A000720(k)/n)). [Ruiz and Sondow]. - Elias Alejandro Angulo Klein, Apr 09 2024

A065890 Number of composites less than the n-th prime.

Original entry on oeis.org

0, 0, 1, 2, 5, 6, 9, 10, 13, 18, 19, 24, 27, 28, 31, 36, 41, 42, 47, 50, 51, 56, 59, 64, 71, 74, 75, 78, 79, 82, 95, 98, 103, 104, 113, 114, 119, 124, 127, 132, 137, 138, 147, 148, 151, 152, 163, 174, 177, 178, 181, 186, 187, 196, 201, 206, 211, 212, 217, 220, 221
Offset: 1

Views

Author

Labos Elemer and Robert G. Wilson v, Nov 28 2001

Keywords

Comments

First differences form A046933, which requires that for this sequence the parity of successive terms alternates.

Examples

			a(25) = 71 since prime(25) = 97 is the 25th prime and 96 is the 71st composite number in A002808.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n)-n-1: n in [1..65]]; // Vincenzo Librandi, Aug 15 2015
    
  • Mathematica
    CompositePi[n_Integer] := (n - PrimePi[n] - 1); Table[ CompositePi[ Prime[n]], {n, 1, 75} ]
  • PARI
    a(n) = { prime(n) - n - 1 } \\ Harry J. Smith, Nov 03 2009
    
  • Python
    from sympy import prime
    def A065890(n): return prime(n)-n-1 # Chai Wah Wu, Oct 11 2024

Formula

a(n) = A065855(A000040(n)).
a(n) = A000040(n)-n-1 = A014689(n)-1 = A014692(n)-2.

A234695 Primes p with prime(p) - p + 1 also prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 23, 31, 41, 43, 61, 71, 83, 89, 103, 109, 139, 151, 173, 181, 199, 211, 223, 241, 271, 277, 281, 293, 307, 311, 317, 337, 349, 353, 367, 463, 499, 541, 563, 571, 601, 661, 673, 709, 719, 743, 751, 757, 811, 823, 827, 883, 907, 911, 953
Offset: 1

Views

Author

Zhi-Wei Sun, Dec 29 2013

Keywords

Comments

By the conjecture in A234694, this sequence should have infinitely many terms.

Examples

			a(1) = 2 since prime(2) - 1 = 2 is prime.
a(2) = 3 since prime(3) - 2 = 3 is prime.
a(3) = 5 since prime(5) - 4 = 7 is prime.
a(4) = 7 since prime(7) - 6 = 11 is prime.
		

Crossrefs

Programs

  • Mathematica
    n=0;Do[If[PrimeQ[Prime[Prime[k]]-Prime[k]+1],n=n+1;Print[n," ",Prime[k]]],{k,1,1000}]
  • PARI
    forprime(p=1,999,isprime(prime(p)-p+1)&&print1(p",")) \\ - M. F. Hasler, Dec 31 2013

Formula

a(n) = prime(A234852(n)). - M. F. Hasler, Dec 31 2013

A234694 a(n) = |{0 < k < n: p = k + prime(n-k) and prime(p) - p + 1 are both prime}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Dec 29 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 9. Also, for any integer n > 51 there is a positive integer k < n such that p = k + prime(n-k) and prime(p) + p + 1 are both prime.
(ii) If n > 9 (or n > 21), then there is a positive integer k < n such that m - 1 and prime(m) + m (or prime(m) - m, resp.) are both prime, where m = k + prime(n-k).
(iii) If n > 483, then for some 0 < k < n both prime(m) + m and prime(m) - m are prime, where m = k + prime(n-k).
(iv) If n > 3, then there is a positive integer k < n such that prime(k + prime(n-k)) + 2 is prime.
Clearly, part (i) of the conjecture implies that there are infinitely many primes p with prime(p) - p + 1 (or prime(p) + p + 1) also prime.
See A234695 for primes p with prime(p) - p + 1 also prime.

Examples

			a(5) = 1 since 2 + prime(3) = 7 and prime(7) - 6 = 11 are both prime.
a(25) = 1 since 20 + prime(5) = 31 and prime(31) - 30 = 97 are both prime.
a(27) = 1 since 18 + prime(9) = 41 and prime(41) - 40 = 139 are both prime.
a(45) = 1 since 6 + prime(39) = 173 and prime(173) - 172 = 859 are both prime.
a(49) = 1 since 26 + prime(23) = 109 and prime(109) - 108 = 491 are both prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_,k_]:=k+Prime[n-k]
    q[n_,k_]:=PrimeQ[f[n,k]]&&PrimeQ[Prime[f[n,k]]-f[n,k]+1]
    a[n_]:=Sum[If[q[n,k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

A330545 a(1) = 2; thereafter a(n) = a(n-1) + (-1)^(n + 1)*(prime(n) - prime(n - 1) - 1) (where prime(k) denotes the k-th prime).

Original entry on oeis.org

2, 2, 3, 2, 5, 4, 7, 6, 9, 4, 5, 0, 3, 2, 5, 0, 5, 4, 9, 6, 7, 2, 5, 0, 7, 4, 5, 2, 3, 0, 13, 10, 15, 14, 23, 22, 27, 22, 25, 20, 25, 24, 33, 32, 35, 34, 45, 34, 37, 36, 39, 34, 35, 26, 31, 26, 31, 30, 35, 32, 33, 24, 37, 34, 35, 32, 45, 40, 49, 48, 51, 46, 53, 48, 53, 50, 55, 48, 51, 44, 53
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2019

Keywords

Comments

a(n) is the column of the Boustrophedon triangle in A330339 that contains prime(n).
If a(n) = 0 then p = prime(n) is a term of A330339, and n is a term of A330546.
Since this has a simple recurrence, it is the key to understanding A330339. However, note that this sequence in turn can be simply expressed in terms of the classic sequence A008347:
a(n) = prime(n) + 1 - 2 * A008347(n) if n is even,
a(n) = 2 * A008347(n) - prime(n) if n is odd.
The sequence that ties all these sequences together is A330547 (q.v.).
First negative term is a(146) = -2.
Note on the links: The illustrations from Angelini and Trump show all the terms 0,1,2,3,4,... (as in A330339), while those of Havermann, Sloane, and Stevenson just show the primes.
The column number mod 4 uniquely determines the residue class of primes mod 4 in that column. If the column number is 0,1,2,3 mod 4 then the primes in that column are 1,3,3,1 respectively (see the "Notes" link). - N. J. A. Sloane, Jan 04 2020
For large n, the graphs of A330545 and A330547 are essentially identical.
Based on the first 10^12 terms, it appears that lim sup |a(n)| is about n^(2/3). This estimate is based on the plots below by Sloane, Trump (the first plot), Havermann (the first plot), and Stevenson (all three plots). - N. J. A. Sloane, Jan 21 2020

Crossrefs

Programs

Formula

G.f.: G(-x)*(x+1)/(x-1), where G(x) = 2*x + 2*x^2 +3*x^3 + 4*x^4 + 7*x^5 + ... is the g.f. for A014692, {prime(n) - (n-1): n >= 1}.

Extensions

Keyword nonn changed to sign by Hans Havermann, Dec 27 2019

A331418 If A331417(n) is the maximum sum of primes of the parts of an integer partition of n, then a(n) = A331417(n) - n + 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 11, 12, 15, 20, 21, 26, 29, 30, 33, 38, 43, 44, 49, 52, 53, 58, 61, 66, 73, 76, 77, 80, 81, 84, 97, 100, 105, 106, 115, 116, 121, 126, 129, 134, 139, 140, 149, 150, 153, 154, 165, 176, 179, 180, 183, 188, 189, 198, 203, 208, 213, 214, 219
Offset: 0

Views

Author

Gus Wiseman, Jan 17 2020

Keywords

Comments

For n > 4, a(n) = A014692(n).

Crossrefs

Converges to A014692.
Row lengths of A331385.
Sum of prime factors is A001414.
Partitions into primes are A000607.
Partitions whose sum of primes is divisible by their sum are A331379.

Programs

  • Mathematica
    Table[Max@@Table[Total[Prime/@y],{y,IntegerPartitions[n]}]-n+1,{n,0,30}]

Formula

a(n) = A331417(n) - n + 1.
Showing 1-10 of 13 results. Next