login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A040976 a(n) = prime(n) - 2. 66
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Numbers n such that n! reduced mod (n+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 pairs of twin primes. - 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)
LINKS
S. A. Khan, Primes in Geometric-Arithmetic Progression, arXiv preprint arXiv:1203.2083 [math.NT], 2012.
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
EXAMPLE
a(13) = 39, because A000040(13) = 41.
MAPLE
seq(ithprime(n)-2, n=1..100); # Muniru A Asiru, Jan 31 2018
MATHEMATICA
Prime[Range[22]]-2 (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
PROG
(Haskell)
a040976 n = a000040 n - 2
a040976_list = map (subtract 2) a000040_list
-- Reinhard Zumkeller, Feb 22 2012
(PARI) a(n)=prime(n)-2 \\ Charles R Greathouse IV, Nov 20 2012
(Magma) [NthPrime(n)-2: n in [1..60]]; // Vincenzo Librandi, Jan 31 2018
(GAP) Filtered([1..10^2], IsPrime)-2; # Muniru A Asiru, Jan 31 2018
CROSSREFS
Equals A359408 \ A360735.
Sequence in context: A024896 A160771 A249426 * A268174 A166104 A164121
KEYWORD
nonn,nice,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 03:33 EDT 2024. Contains 370952 sequences. (Running on oeis4.)