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

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

A232463 Number of ways to write n = p + q - pi(q), where p and q are odd primes not exceeding n, and pi(q) is the number of primes not exceeding q.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 24 2013

Keywords

Comments

Note that this sequence is different from A232443.
Conjecture: a(n) > 0 for all n > 3. Also, a(n) = 1 only for n = 4, 5, 6, 7, 9, 10, 11, 12, 15, 16, 28, 35.

Examples

			a(10) = 1 since 10 = 7 + 7 - pi(7), and 7 is an odd prime not exceeding 10.
a(11) = 1 since 11 = 5 + 11 - pi(11), and 5 and 11 are odd primes not exceeding 11.
a(15) = 1 since 15 = 13 + 5 - pi(5), and 13 and 5 are odd primes not exceeding 15.
a(28) = 1 since 28 = 17 + 19 - pi(19), and 17 and 19 are odd primes not exceeding 28.
a(35) = 1 since 35 = 29 + 11 - pi(11), and 29 and 11 are odd primes not exceeding 35.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=n>2&&PrimeQ[n]
    a[n_]:=Sum[If[PQ[n-Prime[k]+k],1,0],{k,2,PrimePi[n]}]
    Table[a[n],{n,1,100}]

A232861 Numbers k with k - 1, k + 1, prime(k) - k, prime(k) + k, k*prime(k) - 1, k*prime(k) + 1 all prime.

Original entry on oeis.org

22110, 23742, 128238, 275592, 346560, 1061910, 1281522, 1339002, 1378188, 1461600, 1850130, 2064150, 2354952, 2478270, 2523708, 2689260, 2694300, 3916638, 4422618, 4933530, 6179082, 6541080, 6641562, 6740478, 6759030, 7315812, 8484798, 8711010, 9133308, 9687720
Offset: 1

Views

Author

Zhi-Wei Sun, Dec 01 2013

Keywords

Comments

Obviously, each term of the sequence is a multiple of 6.
Conjecture: (i) This sequence contains infinitely many terms.
(ii) Let P(x) be a non-constant integer-valued polynomial with positive leading coefficient. Then, there are infinitely many positive integers k with prime(k) - k in the range P(Z) = {P(m): m is an integer}, if and only if the degree of P(x) is at most 3. We may also replace prime(k) - k by prime(k) + k.

Examples

			a(1) = 22110 with the six numbers 22110 - 1 = 22109, 22110 + 1 = 22111, prime(22110) - 22110 = 228841, prime(22110) + 22110 = 273061, 22110*prime(22110) - 1 = 5548526609, 22110*prime(22110) + 1 = 5548526611 all prime.
		

Crossrefs

Programs

  • Mathematica
    n=0
    Do[If[PrimeQ[k-1]&&PrimeQ[k+1]&&PrimeQ[Prime[k]-k]&& PrimeQ[Prime[k]+k]&& PrimeQ[k*Prime[k]-1]&& PrimeQ[k*Prime[k]+1],n=n+1;Print[n," ",k]],{k,1,9700000}]

A232465 a(n) = |{0 < k <= n/2: prime(k) + prime(n-k) - 1 is prime}|.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 2, 1, 3, 1, 3, 1, 3, 1, 3, 4, 5, 2, 5, 2, 5, 5, 4, 5, 4, 5, 6, 8, 2, 8, 9, 11, 4, 6, 1, 3, 6, 8, 8, 7, 3, 11, 9, 8, 8, 9, 12, 8, 10, 10, 10, 8, 6, 3, 8, 11, 13, 14, 13, 15, 8, 15, 15, 14, 8, 18, 11, 14, 5, 10, 7, 10, 15, 12, 10, 5, 10, 11, 12, 16, 21, 15, 16, 14, 8, 15, 19, 14, 16, 18, 13, 10, 28, 21, 14, 20, 18, 24, 20, 19
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 24 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 except for n = 1, 3, 6. Also, a(n) = 1 only for n = 2, 4, 5, 8, 10, 12, 14, 35.
(ii) For each integer n > 7, there is a positive integer k < n/2 with (prime(n-k) - prime(k))/2 prime. Also, for any positive integer n not among 1, 3, 5, 9, 21, (prime(k) + prime(n-k))/2 is prime for some 0 < k < n.
(iii) For any integer n > 6, prime(k)^2 + prime(n-k)^2 - 1 is prime for some 0 < k < n. Also, for any integer n > 4 not equal to 14, (prime(k)^2 + prime(n-k)^2)/2 is prime for some 0 < k < n.
(iv) For any integer n > 3, (prime(k) - 1)^2 + prime(n-k)^2 is prime for some 0 < k < n. Also, if n > 4 then (prime(k) + 1)^2 + prime(n-k)^2 is prime for some 0 < k < n.

Examples

			a(8) = 1 since prime(4) + prime(4) - 1 = 13 is prime.
a(10) = 1 since prime(4) + prime(6) - 1 = 7 + 13 - 1 = 19 is prime.
a(14) = 1 since prime(6) + prime(8) - 1 = 13 + 19 - 1 = 31 is prime.
a(35) = 1 since prime(2) + prime(33) - 1 = 3 + 137 - 1 = 139 is prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[Prime[k]+Prime[n-k]-1],1,0],{k,1,n/2}]
    Table[a[n],{n,1,100}]

A232548 Number of ways to write n = p - pi(p) + 2^k + 2^m with 0 < k <= m, where p is an odd prime and pi(p) is the number of primes not exceeding p.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 25 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4.
In contrast, R. Crocker proved that there are infinitely many positive odd integers not of the form p + 2^k + 2^m, where p is a prime, and k and m are positive integers.
Qing-Hu Hou has checked the conjecture for n up to 10^7, and found one counterexample: n = 1897048.

Examples

			a(7) = 2 since 7 = 3 - pi(3) + 2 + 2^2 = 7 - pi(7) + 2 + 2, with 3 and 7 odd primes.
a(8) = 1 since 8 = 5 - pi(5) + 2 + 2^2 with 5 an odd prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[n==Prime[k]-k+2^i+2^j,1,0],{k,2,PrimePi[2n]},{j,1,Log[2,n]},{i,1,j}]
    Table[a[n],{n,1,100}]
  • PARI
    a(n)=my(s,ppi=1); forprime(p=3,, if(p-ppi++>n-4,return(s)); if((n-p+ppi)%2==0 && hammingweight(n-p+ppi)<3,s++)) \\ Charles R Greathouse IV, Nov 27 2013

A236541 Number of ways to write 2*n = k + m with 0 < k <= m such that prime(k) + m and k + prime(m) are both prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 28 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 31.
(ii) Any positive even number can be written as k + m with k > 0 and m > 0 such that (prime(k) - k) + m and k + (prime(m) - m) are both prime.
(iii) Each integer n > 24 can be written as k + m with k > 0 and m > 0 such that prime(k) + m*(m-1) and k*(k-1) + prime(m) are both prime.
(iv) Any integer n > 15 can be written as k + m with k > 0 and m > 0 such that prime(k) + phi(m) and phi(k) + prime(m) are both prime.
Part (ii) of the conjecture in A232443 implies that any integer n > 7 can be written as k + m (k > 0, m > 0) with prime(k) + m = n + prime(k) - k prime.

Examples

			a(9) = 1 since 2*9 = 8 + 10 with prime(8) + 10 = 19 + 10 = 29 and 8 + prime(10) = 8 + 29 = 37 both prime.
a(92) = 1 since 2*92 = 86 + 98 with prime(86) + 98 = 443 + 98 = 541 and 86 + prime(98) = 86 + 521 = 607 both prime.
		

Crossrefs

Programs

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

A238402 Number of ways to write n = p^2 + q - pi(q) with p prime and q among 1, ..., n, where pi(.) is given by A000720.

Original entry on oeis.org

0, 0, 0, 0, 3, 2, 2, 1, 1, 4, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 4, 3, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 5, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, 2, 2, 2, 3, 4, 3, 2, 2, 2, 3, 3, 2, 3, 4, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 4, 2, 2, 3
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 26 2014

Keywords

Comments

For any positive integer q, clearly q + 1 - pi(q+1) - (q - pi(q)) = 1 + pi(q) - pi(q+1) is 0 or 1. Thus {q - pi(q): q = 1, ..., n} = {1, 2, ..., n-pi(n)}. Note that n - pi(n) > n/2 for n > 8. If p is at least sqrt(n/2), then n - p^2 <= n/2 and hence n - p^2 = q - pi(q) for some q = 1, ..., n. So it can be proved that a(n) > 0 for all n > 4. - Li-Lu Zhao and Zhi-Wei Sun, Feb 26 2014

Examples

			a(9) = 1 since 9 = 2^2 + 9 - pi(9) with 2 prime and pi(9) = 4.
a(40) = 1 since 40 = 5^2 + 24 - pi(24) with 5 prime and pi(24) = 9.
a(120) = 1 since 120 = 7^2 + 95 - pi(95) with 7 prime and pi(95) = 24.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]&&PrimeQ[Sqrt[n]]
    a[n_]:=Sum[If[SQ[n-q+PrimePi[q]],1,0],{q,1,n}]
    Table[a[n],{n,1,100}]
Showing 1-7 of 7 results.