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

A071348 Intersection of A068017 and A068019: numbers n such that both sigma(n) and phi(n) are middle terms between (different) twin prime pairs.

Original entry on oeis.org

10, 26, 38, 135, 206, 209, 216, 278, 371, 398, 416, 545, 560, 650, 698, 792, 866, 924, 1062, 1125, 1286, 1364, 1403, 1482, 1512, 1946, 2021, 2151, 2306, 2432, 2516, 2920, 3040, 3239, 3263, 3338, 3363, 3398, 3443, 3537, 3758, 3815, 4028, 4041, 4058, 4131
Offset: 1

Views

Author

Labos Elemer, May 21 2002

Keywords

Comments

5 is not a term. Sigma[5]=6, and both 6-1=5 and 6+1=7 are primes. Phi[5]=4, and both 4-1=3 and 4+1=5 are primes. But, even though (3,5) and (5,7) are in some sense "(different) twin prime pairs" (quoting the sequence's definition), because 5 is a member of both they are treated, for purposes of this sequence, as not being "different." - Harvey P. Dale, Jun 05 2019

Examples

			n=4440,6328,6808,7030: sigma[n]=13680 between 13679 and 13681 prime, while Phi[4440]=1152,Phi[6328]=2688,Phi[6808]=3168,Phi[7030]=2592 are middle terms between different twin-pairs; n=545,866,1482,1512: phi[n]=432 between 431 and 433; sigma[n]-s give middle terms between different twin prime pairs.
		

Crossrefs

Programs

  • Mathematica
    Do[s=-1+DivisorSigma[1, n]; s1=1+DivisorSigma[1, n]; z=-1+EulerPhi[n]; z1=1+EulerPhi[n]; If[PrimeQ[s]&&PrimeQ[s1]&& PrimeQ[z]&&PrimeQ[z1]&&!PrimeQ[n], Print[{n, s, s1, z, z1}]], {n, 1, 10000}]
    spmtQ[n_]:=Module[{s=DivisorSigma[1,n],p=EulerPhi[n]},s!=p&&AllTrue[ {s+1, s-1,p+1,p-1},PrimeQ]]; Select[Range[6,4200],spmtQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 05 2019 *)

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
    

A072282 Numbers n such that sigma(n) + 1 and sigma(n) - 1 are twin primes.

Original entry on oeis.org

3, 5, 6, 10, 11, 17, 20, 24, 26, 29, 30, 38, 41, 46, 51, 55, 59, 71, 85, 88, 101, 105, 107, 114, 118, 126, 135, 136, 137, 141, 145, 147, 149, 155, 158, 161, 177, 178, 179, 185, 191, 197, 203, 206, 207, 209, 216, 227, 230, 236, 238, 239, 255, 269, 278, 281, 296
Offset: 1

Views

Author

Joseph L. Pe, Jul 10 2002

Keywords

Examples

			sigma(20) + 1 = 43 and sigma(20) - 1 = 41, so 20 is a term of the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^3], PrimeQ[DivisorSigma[1, # ] + 1] && PrimeQ[DivisorSigma[1, # ] - 1] &]
    Select[Range[300],AllTrue[DivisorSigma[1,#]+{1,-1},PrimeQ]&] (* Harvey P. Dale, Apr 06 2023 *)
  • PARI
    isok(n) = my(p=sigma(n)-1); isprime(p) && isprime(p+2); \\ Michel Marcus, Sep 30 2019

Extensions

More terms from Amiram Eldar, Sep 30 2019

A349981 Midpoints k of a pair of twin primes such that sigma(k) is also the midpoint of a pair of twin primes.

Original entry on oeis.org

6, 30, 462, 1062, 1290, 1482, 1878, 2088, 2790, 3558, 4272, 4338, 6552, 6660, 7308, 8010, 8598, 8820, 10038, 10428, 10530, 10890, 11940, 12042, 12918, 13338, 13758, 16980, 17418, 17580, 18252, 19992, 21588, 22038, 22740, 23742, 25848, 26862, 27738, 32028, 33288, 35730, 37548, 37782, 42180, 42570
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Feb 06 2022

Keywords

Examples

			a(3) = 462 is a term because sigma(462) = 1152 and 461, 463, 1151 and 1153 are primes.
		

Crossrefs

Intersection of A014574 and A068017.

Programs

  • Maple
    filter:= proc(x) local t;
      if not (isprime(x-1) and isprime(x+1)) then return false fi;
      t:= numtheory:-sigma(x);
      t mod 6 = 0 and isprime(t-1) and isprime(t+1)
    end proc:
    select(filter, [seq(i,i=6..100000,6)]);

Formula

a(n) = 6*A202607(n). - Ivan N. Ianakiev, Feb 07 2022
Showing 1-4 of 4 results.