OFFSET
1,2
COMMENTS
a(n) is analogous to A000720.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Eric W. Weisstein, MathWorld: Practical number
Wikipedia, Practical number
EXAMPLE
a(13)=6 as there are 6 practical numbers <= 13, namely 1, 2, 4, 6, 8 and 12.
MAPLE
isprac:= proc(n) local L, i, P;
L:= sort(ifactors(n)[2], (a, b) -> a[1]<b[1]);
if L[1][1] <> 2 then return false fi;
P:= 2^(L[1][2]+1)-1;
for i from 2 to nops(L) do
if L[i][1] > P+1 then return false fi;
P:= P*(L[i][1]^(L[i][2]+1)-1)/(L[i][1]-1);
od;
true
end proc:
isprac(1):= true:
N:= 100: # to get a(1)..a(N)
P:= select(isprac, [1, seq(i, i=2..N, 2)]):
V:= Vector(N):
for n from 2 to nops(P) do V[P[n-1] .. P[n]-1]:= n-1 od:
V[P[-1]..N]:= n:
convert(V, list); # Robert Israel, May 29 2019
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]]]; t={}; n3=1; n4=0; While[n3<100, (If[PracticalQ[n3], n4++]; AppendTo[t, n4]; n3++)]; t (* using T. D. Noe's program A005153 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, May 10 2013
STATUS
approved