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

A237127 Number of ways to write n = k + m (0 < k < m) with k and m terms of A072281.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 04 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 11.
Clearly, this implies the twin prime conjecture.

Examples

			 a(13) = 1 since 13 = 5 + 8 with phi(5) - 1 = 3, phi(5) + 1 = 5, phi(8) - 1 = 3 and phi(8) + 1 = 5 all prime.
a(60) = 1 since 60 = 18 + 42 with phi(18) - 1 = 5, phi(18) + 1 = 7, phi(42) - 1 = 11 and phi(42) + 1 = 13 all prime.
a(84) = 1 since 84 = 7 + 77 with phi(7) - 1 = 5, phi(7) + 1 = 7, phi(77) - 1 = 59 and phi(77) + 1 = 61 all prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=PrimeQ[EulerPhi[n]-1]&&PrimeQ[EulerPhi[n]+1]
    a[n_]:=Sum[If[PQ[k]&&PQ[n-k],1,0],{k,1,(n-1)/2}]
    Table[a[n],{n,1,70}]

A218829 Number of ordered ways to write n = k + m with k > 0 and m > 0 such that prime(k) + 2 and prime(prime(m)) + 2 are both prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 05 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 22, 25, 38, 101, 273.
(ii) Each n = 2, 3, ... can be written as k + m with k > 0 and m > 0 such that 6*k - 1, 6*k + 1 and prime(prime(m)) + 2 are all prime.
(iii) Any integer n > 5 can be written as k + m with k > 0 and m > 0 such that phi(k) - 1, phi(k) + 1 and prime(prime(m)) + 2 are all prime, where phi(.) is Euler's totient function.
(iv) If n > 2 is neither 10 nor 31, then n can be written as k + m with k > 0 and m > 0 such that prime(k) + 2 and prime(prime(prime(m))) + 2 are both prime.
(v) If n > 1 is not equal to 133, then n can be written as k + m with k > 0 and m > 0 such that 6*k - 1, 6*k + 1 and prime(prime(prime(m))) + 2 are all prime.
Clearly, each part of the conjecture implies the twin prime conjecture.
We have verified part (i) for n up to 10^9. See the comments in A237348 for an extension of this part.

Examples

			a(3) = 1 since 3 = 2 + 1 with prime(2) + 2 = 3 + 2 = 5 and prime(prime(1)) + 2 = prime(2) + 2 = 5 both prime.
a(22) = 1 since 22 = 20 + 2 with prime(20) + 2 = 71 + 2 = 73 and prime(prime(2)) + 2 = prime(3) + 2 = 5 + 2 = 7 both prime.
a(25) = 1 since 25 = 2 + 23 with prime(2) + 2 = 3 + 2 = 5 and prime(prime(23)) + 2 = prime(83) + 2 = 431 + 2 = 433 both prime.
a(38) = 1 since 38 = 35 + 3 with prime(35) + 2 = 149 + 2 = 151 and prime(prime(3)) + 2 = prime(5) + 2 = 11 + 2 = 13 both prime.
a(101) = 1 since 101 = 98 + 3 with prime(98) + 2 = 521 + 2 = 523 and prime(prime(3)) + 2 = prime(5) + 2 = 11 + 2 = 13 both prime.
a(273) = 1 since 273 = 2 + 271 with prime(2) + 2 = 3 + 2 = 5 and prime(prime(271)) + 2 = prime(1741) + 2 = 14867 + 2 = 14869 both prime.
		

Crossrefs

Programs

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

A078892 Numbers n such that phi(n) - 1 is prime, where phi is Euler's totient function (A000010).

Original entry on oeis.org

5, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 24, 25, 26, 27, 28, 30, 31, 33, 35, 36, 38, 39, 42, 43, 44, 45, 49, 50, 51, 52, 54, 56, 61, 62, 64, 65, 66, 68, 69, 70, 72, 73, 77, 78, 80, 81, 84, 86, 90, 91, 92, 93, 95, 96, 98, 99, 102, 103, 104, 105, 109, 111, 112, 117
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2002

Keywords

Comments

For all primes p: p is in the sequence iff p is the greater member of a twin prime pair (A006512), see A078893.
Union of A006512 and A078893. - Ray Chandler, May 26 2008

Crossrefs

Programs

A237130 Number of ordered ways to write n = k + m with k > 0 and m > 0 such that both {3*k - 1, 3*k + 1} and {phi(m) - 1, phi(m) + 1} are twin prime pairs, where phi(.) is Euler's totient function.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 04 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 8.
(ii) Any integer n > 6 can be written as k + m with k > 0 and m > 0 such that both {prime(k), prime(k) + 2} and {phi(m) - 1, phi(m) + 1} are twin prime pairs.
(iii) Each n = 12, 13, ... can be written as p + q (q > 0) with p, p + 6, phi(q) - 1 and phi(q) + 1 all prime.
(iv) If n > 2 is neither 10 nor 430, then n can be written as k + m with k > 0 and m > 0 such that both {3k - 1, 3*k + 1} and {6*m - 1, 6*m + 1} are twin prime pairs.
Note that each part of the above conjecture implies the twin prime conjecture.

Examples

			a(7) = 1 since 7 = 2 + 5 with 3*2 - 1 = 5, 3*2 + 1 =7, phi(5) - 1 = 3 and phi(5) + 1 = 5 all prime.
a(140) = 1 since 140 = 104 + 36 with 3*104 - 1 = 311, 3*104 + 1 = 313, phi(36) - 1 = 11 and phi(36) + 1 = 13 all prime.
		

Crossrefs

Programs

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

A237168 Number of ways to write 2*n - 1 = 2*p + q with p, q, phi(p+1) - 1 and phi(p+1) + 1 all prime, where phi(.) is Euler's totient function.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 04 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 12.
(ii) Any even number greater than 4 can be written as p + q with p, q, phi(p+2) - 1 and phi(p+2) + 1 all prime.
Part (i) implies both Lemoine's conjecture (cf. A046927) and the twin prime conjecture, while part (ii) unifies Goldbach's conjecture and the twin prime conjecture.

Examples

			a(9) = 1 since 2*9 - 1 = 2*7 + 3 with 7, 3, phi(7+1) - 1 = 3 and phi(7+1) + 1 = 5 all prime.
a(934) = 1 since 2*934 - 1 = 2*457 + 953 with 457, 953, phi(457+1) - 1 = 227 and phi(457+1) + 1 = 229 all prime.
		

Crossrefs

Programs

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

A068019 Composite n such that both 1 + phi(n) and -1 + phi(n) are primes, i.e., phi(n) is the middle term between twin primes (A014574).

Original entry on oeis.org

8, 9, 10, 12, 14, 18, 21, 26, 27, 28, 36, 38, 42, 49, 54, 62, 77, 86, 91, 93, 95, 98, 99, 111, 117, 122, 124, 133, 135, 146, 148, 152, 154, 171, 182, 186, 189, 190, 198, 206, 209, 216, 217, 218, 221, 222, 228, 234, 252, 266, 270, 278, 279, 287, 291, 297, 302
Offset: 1

Views

Author

Labos Elemer, Feb 08 2002

Keywords

Comments

A072281 with the primes removed; intersection of A066071 and A078893. - Ray Chandler, May 26 2008

Examples

			n = 21, 26, 28, 36, 42 give phi(n)=12; the corresponding twin primes are {11,13}.
		

Crossrefs

Programs

  • GAP
    Filtered([1..310],n->not IsPrime(n) and IsPrime(1+Phi(n)) and IsPrime(-1+Phi(n))); # Muniru A Asiru, Dec 08 2018
  • Mathematica
    Do[s=-1+EulerPhi[n]; s1=1+EulerPhi[n]; If[PrimeQ[s]&&PrimeQ[s1]&&!PrimeQ[n], Print[n]], {n, 1, 2000}]
    (* Second program: *)
    Select[Range[4, 302], And[CompositeQ@ #, AllTrue[EulerPhi@ # + {-1, 1}, PrimeQ]] &] (* Michael De Vlieger, Dec 08 2018 *)
  • PARI
    isok(n) = !isprime(n) && isprime(eulerphi(n)+1) && isprime(eulerphi(n)-1); \\ Michel Marcus, Dec 08 2018
    

A237253 Number of ordered ways to write n = k + m with k > 0 and m > 0 such that phi(k) - 1, phi(k) + 1 and prime(prime(prime(m))) - 2 are all prime, where phi(.) is Euler's totient function.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 05 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 7.
(ii) Any integer n > 22 can be written as k + m with k > 0 and m > 0 such that prime(k) + 2 and prime(prime(prime(m))) - 2 are both prime.
Note that either part of the conjecture implies the twin prime conjecture.

Examples

			 a(12) = 1 since 12 = 9 + 3 with phi(9) - 1 = 5, phi(9) + 1 = 7 and prime(prime(prime(3))) - 2 = prime(prime(5)) - 2 = prime(11) - 2 = 29 all prime.
a(103) = 1 since 103 = 73 + 30 with phi(73) - 1 = 71, phi(73) + 1 = 73 and prime(prime(prime(30))) - 2 = prime(prime(113)) - 2 = prime(617) - 2 = 4547 all prime.
		

Crossrefs

Programs

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

A237183 Primes p with phi(p+1) - 1 and phi(p+1) + 1 both prime, where phi(.) is Euler's totient function.

Original entry on oeis.org

7, 11, 13, 17, 37, 41, 53, 61, 97, 151, 181, 197, 227, 233, 251, 269, 277, 397, 433, 457, 487, 541, 557, 571, 593, 619, 631, 719, 743, 769, 839, 857, 929, 941, 947, 953, 1013, 1021, 1049, 1061, 1063, 1201, 1237, 1277, 1307, 1321, 1367, 1481, 1511, 1549
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 04 2014

Keywords

Comments

According to part (i) of the conjecture in A237168, this sequence should have infinitely many terms.

Examples

			a(1) = 7 since 7, phi(7+1) - 1 = 3 and phi(7+1) + 1 = 5 are all prime, but phi(2+1) - 1 = phi(3+1) - 1 = phi(5+1) - 1 = 1 is not prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=PrimeQ[EulerPhi[n]-1]&&PrimeQ[EulerPhi[n]+1]
    n=0;Do[If[PQ[Prime[k]+1],n=n+1;Print[n," ",Prime[k]]],{k,1,10000}]
    Select[Prime[Range[300]],And@@PrimeQ[EulerPhi[#+1]+{1,-1}]&] (* Harvey P. Dale, Mar 06 2014 *)
  • PARI
    s=[]; forprime(p=2, 2000, if(isprime(eulerphi(p+1)-1) && isprime(eulerphi(p+1)+1), s=concat(s, p))); s \\ Colin Barker, Feb 04 2014

A237531 a(n) = |{0 < k < n/2: phi(k*(n-k)) - 1 and phi(k*(n-k)) + 1 are both prime}|, where phi(.) is Euler's totient function.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 09 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 5.
Clearly, this implies the twin prime conjecture.

Examples

			a(12) = 1 since 12 = 3 + 9 with phi(3*9) - 1 = 17 and phi(3*9) + 1 = 19 both prime.
a(19) = 1 since 19 = 1 + 18 with phi(1*18) - 1 = 5 and phi(1*18) + 1 = 7 both prime.
a(86) = 1 since 86 = 8 + 78 with phi(8*78) - 1 = 191 and phi(8*78) + 1 = 193 both prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[EulerPhi[n]-1]&&PrimeQ[EulerPhi[n]+1]
    a[n_]:=Sum[If[p[k(n-k)],1,0],{k,1,(n-1)/2}]
    Table[a[n],{n,1,80}]
Showing 1-9 of 9 results.