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).

This page as a plain text file.
%I A225223 #12 May 13 2013 01:54:23
%S A225223 3,5,7,11,17,19,23,29,31,41,47,53,59,71,79,83,89,103,107,127,131,139,
%T A225223 149,167,179,191,197,199,223,227,233,239,251,263,269,271,293,307,311,
%U A225223 347,359,367,379,383,389,419,431,439,449,461,463,467,479,499,503,509
%N A225223 Primes of the form p - 1, where p is a practical number (A005153).
%H A225223 Charles R Greathouse IV, <a href="/A225223/b225223.txt">Table of n, a(n) for n = 1..10000</a>
%e A225223 a(5)=17 as 18 is a practical number, 18-1=17 and it is the 5th such prime.
%t A225223 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]]];
%t A225223 Select[Table[Prime[n]+1, {n, 1, 200}], PracticalQ]-1 (* using T. D. Noe's program A005153 *)
%o A225223 (PARI) isPractical(n)={
%o A225223     if(n%2,return(n==1));
%o A225223     my(f=factor(n),P=1);
%o A225223     for(i=1,#f[,1]-1,
%o A225223         P*=sigma(f[i,1]^f[i,2]);
%o A225223         if(f[i+1,1]>P+1,return(0))
%o A225223     );
%o A225223     n>0
%o A225223 };
%o A225223 select(p->isPractical(p+1),primes(300)) \\ _Charles R Greathouse IV_, May 03 2013
%Y A225223 Cf. A005153, A085498.
%K A225223 nonn
%O A225223 1,1
%A A225223 _Frank M Jackson_, May 02 2013