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

A092954 Index of the first occurrence of n in A092953. There are a(n) primes p < n such that n+p is a prime.

Original entry on oeis.org

1, 3, 8, 12, 26, 40, 24, 48, 42, 54, 110, 60, 140, 84, 160, 90, 132, 126, 162, 120, 168, 216, 204, 222, 246, 180, 264, 252, 240, 210, 366, 342, 270, 396, 300, 414, 336, 516, 850, 558, 330, 462, 534, 552, 390, 504, 450, 1040, 540, 588, 420, 594, 708, 510, 876
Offset: 0

Views

Author

Amarnath Murthy, Mar 24 2004

Keywords

Examples

			a(6) = 24 as there are 6 values the prime p can take, 5, 7, 13, 17, 19 and 23 < 24 so that 24 + p is also prime.
		

Crossrefs

Cf. A092953.

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a092954 = (+ 1) . fromJust . (`elemIndex` a092953_list)
    -- Reinhard Zumkeller, Nov 10 2012
  • PARI
    {stop=1050;m=56;v=vector(m,x,-1);for(n=1,stop,c=0;forprime(p=2,n-1,if(isprime(n+p),c++)); if(c
    				

Extensions

More terms from Klaus Brockhaus and Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 25 2004

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

A007921 Numbers that are not the difference of two primes.

Original entry on oeis.org

7, 13, 19, 23, 25, 31, 33, 37, 43, 47, 49, 53, 55, 61, 63, 67, 73, 75, 79, 83, 85, 89, 91, 93, 97, 103, 109, 113, 115, 117, 119, 121, 123, 127, 131, 133, 139, 141, 143, 145, 151, 153, 157, 159, 163, 167, 169, 173, 175, 181, 183, 185, 187, 193
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Conjecturally, odd numbers k such that k+2 is composite.
Is this the same as A068780(2n-1) - 1? - J. Stauduhar, Aug 23 2012
A092953(a(n)) = 0. - Reinhard Zumkeller, Nov 10 2012
It seems that the sequence contains the squares of all primes except for 2 and 3. - Ivan N. Ianakiev, Aug 29 2013 [It does: For every prime p > 3, note that p^2 == 1 (mod 3), so p^2 cannot be q - r where q and r are primes. (If it were, then since p^2 is odd, q and r could not both be odd primes; r would have to be the even prime, 2, which would mean that p^2 = q - 2, so q = p^2 + 2 == 0 (mod 3), i.e., 3 would divide q, so q would not be prime -- a contradiction.) - Jon E. Schoenfield, May 03 2024]
Integers d such that A123556(d) = 1, that is, integers d such that the largest possible arithmetic progression (AP) of primes with common difference d has only one element. For each such d, the unique element of all the first largest APs with 1 element is A342309(d) = 2. - Bernard Schott, Jan 08 2023
If it exists, the least even term is > 10^12 (see 1st comment in A020483). - Bernard Schott, Jan 09 2023

References

  • F. Smarandache, Properties of Numbers, 1972. (See Smarandache odd sieve.)

Crossrefs

Cf. A048859.
Complement of A030173. Cf. A001223.
Cf. also A005408, A010051.
Largest AP of prime numbers with k elements: this sequence (k=1), A359408 (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), A359410 (k=6), A206041 (k=7), A206042 (k=8), A206043 (k=9), A206044 (k=10), A206045 (k=11).

Programs

  • Haskell
    a007921 n = a007921_list !! (n-1)
    a007921_list = filter ((== 0) . a010051' . (+ 2)) [1, 3 ..]
    -- Reinhard Zumkeller, Jul 03 2015
    
  • Maple
    filter :=  d -> irem(d, 2) <> 0 and not isprime(2+d) : select(filter, [`$`(1 .. 200)]); # Bernard Schott, Jan 08 2023
  • Mathematica
    Lim=200;nn=10;seq:=Complement[Range[Lim],Union[Flatten[Differences/@Subsets[Prime[Range[nn]],{2}]]]];Until[AllTrue[seq,OddQ],nn++];seq (* James C. McMahon, May 04 2024 *)
  • PARI
    is(n)=n%2 && !isprime(n+2) \\ On Polignac's conjecture; Charles R Greathouse IV, Jun 28 2013
    
  • Python
    from sympy import isprime
    print([n for n in range(1, 200) if n%2 and not isprime(n + 2)]) # Indranil Ghosh, Jun 15 2017, after Charles R Greathouse IV

A061357 Number of 0

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 3, 2, 3, 4, 1, 3, 4, 3, 3, 5, 4, 3, 5, 3, 3, 6, 2, 5, 6, 2, 5, 6, 4, 5, 7, 4, 4, 8, 4, 4, 9, 4, 4, 7, 3, 6, 8, 5, 5, 8, 6, 7, 10, 6, 5, 12, 3, 5, 10, 3, 7, 9, 5, 5, 8, 7, 7, 11, 5, 5, 12, 4, 8, 11, 4, 8, 10, 5, 5, 13, 9, 6, 11, 7, 6, 14, 6, 8, 13, 5, 8, 11, 6, 9
Offset: 1

Views

Author

Amarnath Murthy, Apr 28 2001

Keywords

Comments

Number of prime pairs (p,q) with p < n < q and q-n = n-p.
The same as the number of ways n can be expressed as the mean of two distinct primes.
Conjecture: for n>=4 a(n)>0. - Benoit Cloitre, Apr 29 2003
Conjectures from Rick L. Shepherd, Jun 24 2003: (Start)
1) For each integer N>=1 there exists a positive integer m(N) such that for n>=m(N) a(n)>a(N). (After the first m(N)-1 terms, a(N) does not reappear). In particular, for N=1 (or 2 or 3), m(N)=4 and a(N)=0, giving Benoit Cloitre's conjecture. (cont.)
(cont.) Conjectures based upon observing a(1),...,a(10000):
m(4)=m(5)=m(6)=m(7)=m(19)=20 for a(4)=a(5)=a(6)=a(7)=a(19)=1,
m(8)=...(7 others)...=m(34)=35 for a(8)=...(7 others)...=a(34)=2,
m(12)=...(10 others)...=m(64)=65 for a(12)=...(10 others)...=a(64)=3,
m(18)=...(10 others)...=m(79)=80 for a(18)=...(10 others)...=a(79)=4,
m(24)=...(14 others)...=m(94)=95 for a(24)=...(14 others)...=a(94)=5,
m(30)=...(17 others)...=m(199)=200 for a(30)=...(17 others)...=a(199)=6, etc.
2) Each nonnegative integer appears at least once in the current sequence.
3) Stronger than 2): A001477 (nonnegative integers) is a subsequence of the current sequence. (Supporting evidence: I've observed that 0,1,2,...,175 is a subsequence of a(1),...,a(10000)).
(End)
a(n) is also the number of k such that 2*k+1=p and 2*(n-k-1)+1=q are both odd primes with p < q with p*q = n^2 - m^2. [Pierre CAMI, Sep 01 2008]
Also: Number of ways n^2 can be written as b^2+pq where 0
a(n) = sum (A010051(2*n - p): p prime < n). [Reinhard Zumkeller, Oct 19 2011]
a(n) is also the number of partitions of 2*n into two distinct primes. See the first formula by T. D. Noe, and the Alois P. Heinz, Nov 14 2012, crossreference. - Wolfdieter Lang, May 13 2016
All 0Jamie Morken, Jun 02 2017
a(n) is the number of appearances of n in A143836. - Ya-Ping Lu, Mar 05 2023

Examples

			a(10)= 2: there are two such pairs (3,17) and (7,13), as 10 = (3+17)/2 = (7+13)/2.
		

Crossrefs

Cf. A071681 (subsequence for prime n only).
Cf. A092953.
Bisection of A117929 (even part). - Alois P. Heinz, Nov 14 2012

Programs

  • Haskell
    a061357 n = sum $
       zipWith (\u v -> a010051 u * a010051 v) [n+1..] $ reverse [1..n-1]
    -- Reinhard Zumkeller, Nov 10 2012, Oct 19 2011
    
  • Mathematica
    Table[Count[Range[n - 1], k_ /; And[PrimeQ[n - k], PrimeQ[n + k]]], {n, 98}] (* Michael De Vlieger, May 14 2016 *)
  • PARI
    a(n)=my(s);forprime(p=2,n-1,s+=isprime(2*n-p));s \\ Charles R Greathouse IV, Mar 08 2013
    
  • Python
    from sympy import primerange, isprime
    def A061357(n): return sum(1 for p in primerange(n) if isprime((n<<1)-p)) # Chai Wah Wu, Sep 03 2024

Formula

a(n) = A045917(n) - A010051(n). - T. D. Noe, May 08 2007
a(n) = sum(A010051(n-k)*A010051(n+k): 1 <= k < n). - Reinhard Zumkeller, Nov 10 2012
a(n) = sum_{i=2..n-1} A010051(i)*A010051(2n-i). [Wesley Ivan Hurt, Aug 18 2013]

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001

A030173 Differences p(i)-p(j) between primes, sorted in numerical order.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 35, 36, 38, 39, 40, 41, 42, 44, 45, 46, 48, 50, 51, 52, 54, 56, 57, 58, 59, 60, 62, 64, 65, 66, 68, 69, 70, 71, 72, 74, 76, 77, 78, 80, 81, 82, 84, 86, 87, 88, 90
Offset: 1

Author

Alexander Grasser [Graesser] (alex(AT)computicket.com)

Keywords

Comments

Conjectured (Polignac 1849) to be union of even numbers and the odd primes minus 2.
For n > 2: A092953(a(n)) > 0. - Reinhard Zumkeller, Nov 10 2012

Crossrefs

Complement of A007921. Cf. A001223, A005843, A040976.

Programs

  • Haskell
    import Data.List.Ordered (union)
    a030173 n = a030173_list !! (n-1)
    a030173_list = union [2, 4 ..] $ tail a040976_list
    -- Reinhard Zumkeller, Jul 03 2015
  • Mathematica
    nn = 90; Union[Range[2, nn, 2], Prime[Range[2, PrimePi[nn+2]]] - 2]
  • PARI
    print1(1);p=3;forprime(q=5,1e3,forstep(n=p-1,q-3,2,print1(", "n));print1(", ",q-2);p=q) \\ conjectural; Charles R Greathouse IV, Jul 02 2011
    
  • PARI
    isOK(n)=if(n%2,isprime(n+2),forprime(p=3,,isprime(n+p)&&return(1)));
    for(n=1,10^100,isOK(n)&print1(n,", ")) \\ unconditionally outputs correct values only, will "hang" forever if conjecture is false once that exceptional even number is reached; Jeppe Stig Nielsen, Sep 23 2015
    

A202472 Goldbach's Problem extended to subtraction: number of decompositions of 2n into unordered differences of two primes, p, q, where p < 2n < q.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 2, 3, 3, 3, 2, 6, 4, 3, 6, 3, 4, 6, 4, 5, 8, 4, 4, 7, 6, 4, 9, 8, 4, 11, 5, 5, 11, 6, 8, 9, 4, 7, 11, 7, 4, 13, 7, 5, 15, 7, 8, 13, 8, 9, 11, 7, 7, 13, 10, 5, 13, 7, 7, 19, 9, 8, 17, 9, 10, 16, 9, 9, 15, 12, 7, 19, 9, 7, 19, 9, 12, 17, 8, 14
Offset: 1

Author

James D. Klein, Dec 19 2011

Keywords

Crossrefs

Extension of A002375.
Bisection of A092953.

Programs

  • Mathematica
    Table[Length[Select[Prime[Range[PrimePi[2*n]]], PrimeQ[2*n + #] &]], {n, 100}] (* T. D. Noe, Apr 16 2013 *)
  • PARI
    a(n)=my(s);forprime(p=2,2*n,s+=isprime(2*n+p));s \\ Charles R Greathouse IV, Dec 19 2011
    (C++)
    #include 
    using namespace std;
    int main()
    { int p[25] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
      int count, istart = 2;
      for(int n=1; n<=25; n++)
      {
          if(2*n>p[istart]) istart++;
          count = 0;
          for(int j=1; p[j]<2*n; j++)
            for(int i=istart; p[i]-p[j]<=2*n; i++)
              if(p[i]-p[j]==2*n) count++;
          cout << n << ". " << count << endl;
      }
        return 0;
    } // code for the first 25 integers, James D. Klein, Dec 21 2011

Formula

a(n) = A092953(2*n). - Bill McEachen, May 24 2024
Showing 1-6 of 6 results.