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.

A225223 Primes of the form p - 1, where p is a practical number (A005153).

Original entry on oeis.org

3, 5, 7, 11, 17, 19, 23, 29, 31, 41, 47, 53, 59, 71, 79, 83, 89, 103, 107, 127, 131, 139, 149, 167, 179, 191, 197, 199, 223, 227, 233, 239, 251, 263, 269, 271, 293, 307, 311, 347, 359, 367, 379, 383, 389, 419, 431, 439, 449, 461, 463, 467, 479, 499, 503, 509
Offset: 1

Views

Author

Frank M Jackson, May 02 2013

Keywords

Examples

			a(5)=17 as 18 is a practical number, 18-1=17 and it is the 5th such prime.
		

Crossrefs

Programs

  • Mathematica
    PracticalQ[n_] := Module[{f, p, e, prod = 1, ok = True}, If[n<1||(n>1&&OddQ[n]), False, If[n==1, True, f=FactorInteger[n]; {p, e}=Transpose[f]; Do[If[p[[i]]>1+DivisorSigma[1, prod], ok=False; Break[]]; prod=prod*p[[i]]^e[[i]], {i, Length[p]}]; ok]]];
    Select[Table[Prime[n]+1, {n, 1, 200}], PracticalQ]-1 (* using T. D. Noe's program A005153 *)
  • PARI
    isPractical(n)={
        if(n%2,return(n==1));
        my(f=factor(n),P=1);
        for(i=1,#f[,1]-1,
            P*=sigma(f[i,1]^f[i,2]);
            if(f[i+1,1]>P+1,return(0))
        );
        n>0
    };
    select(p->isPractical(p+1),primes(300)) \\ Charles R Greathouse IV, May 03 2013