OFFSET
1,1
MAPLE
N:= 10^7: # to get all terms <= N
Q:= select(isprime, [seq(q, q=5..N/9, 4)]):
filter:= proc(n) local s; uses numtheory;
s:= sigma(n);
issqrfree(s) and andmap(p -> (n-1 mod (p-1) = 0), factorset(s));
end proc:
select(filter, {seq(seq(q*m^2, m = 3..floor(sqrt(N/q)), 2), q=[1, op(Q)])}); # Robert Israel, Sep 21 2016
MATHEMATICA
M = 10^7; (* to get all terms <= M *)
Q = Select[Range[5, M/9, 4], PrimeQ];
filter[n_] := Module[{s = DivisorSigma[1, n]}, SquareFreeQ[s] && AllTrue[FactorInteger[s][[All, 1]], Mod[n-1, #-1] == 0&]];
Select[Union@Flatten[Table[Table[q*m^2, {m, 3, Floor[Sqrt[M/q]], 2}], {q, Prepend[Q, 1]}]], filter] (* Jean-François Alcover, May 24 2023, after Robert Israel *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Oct 09 2016
STATUS
approved