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.

A171130 Primes p such that sum of divisors of p+2 is prime.

Original entry on oeis.org

2, 7, 23, 727, 2399, 5039, 7919, 17159, 28559, 29927, 85847, 458327, 552047, 579119, 707279, 1190279, 3418799, 3728759, 4532639, 5166527, 5331479, 7447439, 10374839, 24137567, 25877567, 28398239, 30260999, 43546799, 47458319, 52258439, 56957207, 62425799
Offset: 1

Views

Author

Keywords

Comments

If p is a term then p+2 is a prime power with an even exponent (A056798). - Amiram Eldar, Aug 01 2024

Examples

			2 is a term since it is a prime and sigma(2+2) = 7 is a prime.
7 is a term since it is a prime and sigma(7+2) = 13 is a prime.
23 is a term since it is a prime and sigma(23+2) = 31 is a prime.
727 is a term since it is a prime and sigma(727+2) = 1093 is a prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A171130:=n->`if`(isprime(n) and isprime(sigma(n+2)), n, NULL): seq(A171130(n), n=1..10^5); # Wesley Ivan Hurt, Sep 30 2014
  • Mathematica
    f[n_]:=Plus@@Divisors[n]; lst={};Do[p=Prime[n];If[PrimeQ[f[p+2]],AppendTo[lst,p]],{n,10!}];lst
    Select[Prime[Range[700000]],PrimeQ[DivisorSigma[1,#+2]]&] (* Harvey P. Dale, Jun 23 2011 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (isprime(sigma(p+2)), print1(p, ", "))); \\ Michel Marcus, Sep 30 2014
    
  • PARI
    lista(kmax) = {my(p); for(k = 1, kmax, if(isprime(k) || isprimepower(k), p = k^2-2; if(isprime(p) && isprime(sigma(p+2)), print1(p, ", "))));} \\ Amiram Eldar, Aug 01 2024

Extensions

More terms from Michel Marcus, Sep 30 2014