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.

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

This page as a plain text file.
%I A040976 #150 Dec 14 2024 14:43:11
%S A040976 0,1,3,5,9,11,15,17,21,27,29,35,39,41,45,51,57,59,65,69,71,77,81,87,
%T A040976 95,99,101,105,107,111,125,129,135,137,147,149,155,161,165,171,177,
%U A040976 179,189,191,195,197,209,221,225,227,231,237,239,249,255,261
%N A040976 a(n) = prime(n) - 2.
%C A040976 Numbers k such that k! reduced mod (k+2) is 1. - _Benoit Cloitre_, Mar 11 2002
%C A040976 The first a(n) numbers starting from 2 are divisible by primes up to prime(n-1). - _Lekraj Beedassy_, Jun 21 2006
%C A040976 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
%C A040976 The primes in this sequence are the initial primes of twin prime pairs. - _Sebastiao Antonio da Silva_, Dec 21 2008
%C A040976 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
%C A040976 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
%C A040976 From _Bernard Schott_, Feb 19 2023: (Start)
%C A040976 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.
%C A040976 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.
%C A040976 Similar sequence with even common differences d is A360735.
%C A040976 This subsequence of A359408 corresponds to the first case: '2 is prime'; second case corresponding to the even common differences d is A360735. (End)
%H A040976 Reinhard Zumkeller, <a href="/A040976/b040976.txt">Table of n, a(n) for n = 1..10000</a>
%H A040976 S. A. Khan, <a href="http://arxiv.org/abs/1203.2083">Primes in Geometric-Arithmetic Progression</a>, arXiv preprint arXiv:1203.2083 [math.NT], 2012.
%H A040976 S. M. Ruiz and J. Sondow, <a href="https://arxiv.org/abs/math/0210312">Formulas for pi(n) and the n-th prime</a>, arXiv:math/0210312 [math.NT], 2002-2014.
%H A040976 Wikipedia, <a href="https://en.wikipedia.org/wiki/Primes_in_arithmetic_progression">Primes in arithmetic progression</a>.
%H A040976 <a href="/index/Pri#primes_AP">Index entries for sequences related to primes in arithmetic progressions</a>.
%F A040976 a(n) = A000040(n) - 2 = Sum_{i=1..n-1} A001223(i).
%F A040976 For n > 2: A092953(a(n)) = 1. - _Reinhard Zumkeller_, Nov 10 2012
%F A040976 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
%F A040976 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
%e A040976 a(13) = 39, because A000040(13) = 41.
%p A040976 seq(ithprime(n)-2,n=1..100); # _Muniru A Asiru_, Jan 31 2018
%t A040976 Prime[Range[22]]-2 (* _Vladimir Joseph Stephan Orlovsky_, Apr 29 2008 *)
%o A040976 (Haskell)
%o A040976 a040976 n = a000040 n - 2
%o A040976 a040976_list = map (subtract 2) a000040_list
%o A040976 -- _Reinhard Zumkeller_, Feb 22 2012
%o A040976 (PARI) a(n)=prime(n)-2 \\ _Charles R Greathouse IV_, Nov 20 2012
%o A040976 (Magma) [NthPrime(n)-2: n in [1..60]]; // _Vincenzo Librandi_, Jan 31 2018
%o A040976 (GAP) Filtered([1..10^2],IsPrime)-2; # _Muniru A Asiru_, Jan 31 2018
%Y A040976 Cf. A000040, A001223, A014689, A014692.
%Y A040976 Equals A359408 \ A360735.
%Y A040976 Cf. A123556, A342309.
%Y A040976 First column of A086800, and of A379011, last diagonal of A090321, and of A162621.
%Y A040976 See also irregular triangles A103728, A319148, A369497.
%K A040976 nonn,nice,easy
%O A040976 1,3
%A A040976 _Felice Russo_