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-3 of 3 results.

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

A359408 Integers d such that the longest possible arithmetic progression (AP) of primes with common difference d has only two elements.

Original entry on oeis.org

1, 3, 5, 9, 11, 15, 16, 17, 21, 22, 26, 27, 29, 32, 35, 39, 41, 44, 45, 46, 51, 52, 56, 57, 58, 59, 62, 65, 69, 70, 71, 74, 76, 77, 81, 82, 86, 87, 88, 92, 95, 99, 100, 101, 105, 105, 106, 107, 111, 112, 116, 118, 122, 125, 128, 129, 130, 135, 136, 137, 140, 142, 146, 147, 148, 149, 152, 155
Offset: 1

Views

Author

Bernard Schott, Dec 30 2022

Keywords

Comments

As '2 is prime' and also '2 is one less than prime 3' (see A173919), there exist two subsequences with k = 2 elements in these APs of primes (see examples).
1. If d is an odd term, then d is in A040976 \ {0} with d = prime(m) - 2, for some m >= 2, and, for each such d, there exists only one longest possible AP of primes, and this AP is always: (2, prime(m)) = (2, d+2), so starts with 2. This subsequence corresponds to the first case: '2 is prime'.
2. If d is an even term, then d is in A360735 and the longest corresponding APs of primes are of the form (q, q+d) with q odd primes. This subsequence corresponds to the second case '2 is one less than prime 3'.
A342309(d) gives the first element of the smallest AP with 2 elements whose common difference is a(n) = d.
The two elements of these APs are not necessarily consecutive primes.

Examples

			d = 1 is a term because the only longest AP of primes with common difference 1 is (2, 3) that has 2 elements because 4 is composite.
d = 3 is a term because the only longest AP of primes with common difference 3 is (2, 5) that has 2 elements because 8 is composite.
d = 5 is a term because the only longest AP of primes with common difference 5 is (2, 7) that has 2 elements because 12 is composite.
d = 16 is a term because the first longest APs of primes with common difference 16 are (3, 19), (7,23), (13, 29), ... that all have 2 elements; the first one that starts with A342309(16) = 3 is (3, 19).
d = 22 is a term because the first longest APs of primes with common difference 22 are (7, 29), (19, 41), (31, 53), ... that all have 2 elements; the first one that starts with A342309(22) = 7 is (7, 29).
		

Crossrefs

Equals disjoint union of A040976 \ {0} and A360735.
Longest AP of prime numbers with exactly k elements: A007921 (k=1), this sequence (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), A359410 (k=6), A206041 (k=7), A360146 (k=10), A206045 (k=11)

Programs

  • Maple
    filter := d -> irem(d, 2) = 0 and irem(d, 3) <> 0 and not isprime(3+d) or irem(d, 2) = 0 and irem(d, 3) <> 0 and isprime(3+d) and not isprime(3+2*d) or isprime(d+2) : select(filter, [$(1 .. 155)]);
  • Mathematica
    Select[Range[155], Mod[#,2]==0 && Mod[#,3]!=0 && !PrimeQ[3+#] || Mod[#,2]==0 && Mod[#,3]!=0 && PrimeQ[3+#] && !PrimeQ[3+2#] || PrimeQ[#+2] &] (* Stefano Spezia, Jan 08 2023 *)

Formula

m is a term iff A123556(m) = 2.

A173919 Numbers that are prime or one less than a prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 16, 17, 18, 19, 22, 23, 28, 29, 30, 31, 36, 37, 40, 41, 42, 43, 46, 47, 52, 53, 58, 59, 60, 61, 66, 67, 70, 71, 72, 73, 78, 79, 82, 83, 88, 89, 96, 97, 100, 101, 102, 103, 106, 107, 108, 109, 112, 113, 126, 127, 130, 131, 136, 137, 138, 139
Offset: 1

Views

Author

Giovanni Teofilatto, Mar 02 2010

Keywords

Comments

Indices of the triangular numbers in A147846.
Integers k such that k or k+1 is prime. - Giovanni Teofilatto, Mar 05 2010
For a given common difference d, there always exists a longest possible arithmetic progression (AP) of primes, and the number of elements k in this AP of primes is necessarily a term of this sequence. See A123556 for explanations. - Bernard Schott, Mar 18 2023

Crossrefs

Complement to A068780. [Giovanni Teofilatto, Mar 11 2010]

Programs

  • Mathematica
    {#-1,#}&/@Prime[Range[40]]//Flatten//Union (* Harvey P. Dale, Dec 21 2018 *)

Formula

Extensions

Definition corrected and sequence extended by R. J. Mathar, Feb 24 2010, Mar 05 2010
Showing 1-3 of 3 results.