OFFSET
1,1
COMMENTS
There are infinitely many practical numbers k such that k^4 + 2 is also practical (see Wang and Sun Theorem 1.3). - Michel Marcus, Nov 03 2018
LINKS
Li-Yuan Wang and Zhi-Wei Sun, On practical numbers of some special forms, arXiv preprint arXiv:1809.01532 [math.NT], 2018. See Theorem 1.3 p. 3.
EXAMPLE
2 and 18 = 2^4 + 2 are practical, hence 2 is a term. - Michel Marcus, Nov 03 2018
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]]]; (* A005153 *)
a[q_]:=If[PracticalQ[q] && PracticalQ[q^4+2], q]; DeleteCases[Array[a, 25000], Null]
PROG
(PARI)
is_A321308(n) = is_A005153(n) && is_A005153(n^4+2); \\ Michel Marcus, Nov 03 2018. [Stale copy of is_A005153 removed here. Please do not duplicate code, it will necessarily become obsolete or worse. - M. F. Hasler, Jun 19 2023]
(Python)
from itertools import count, islice
from math import prod
from sympy import factorint
def A321308_gen(startvalue=2): # generator of terms >= startvalue
for m in count(max(startvalue, 2)+(max(startvalue, 2)&1), 2):
f = list(factorint(m).items())
if all(f[i][0] <= 1+prod((f[j][0]**(f[j][1]+1)-1)//(f[j][0]-1) for j in range(i)) for i in range(len(f))):
f = list(factorint(m**4+2).items())
if all(f[i][0] <= 1+prod((f[j][0]**(f[j][1]+1)-1)//(f[j][0]-1) for j in range(i)) for i in range(len(f))):
yield m
CROSSREFS
KEYWORD
nonn
AUTHOR
Stefano Spezia, Nov 03 2018
STATUS
approved