7 lines
352 B
Plaintext
7 lines
352 B
Plaintext
ClearAll[DuffianQ]
|
|
DuffianQ[n_Integer] := CompositeQ[n] \[And] CoprimeQ[DivisorSigma[1, n], n]
|
|
dns = Select[DuffianQ][Range[1000000]];
|
|
Take[dns, UpTo[50]]
|
|
triplets = ToString[dns[[#]]] <> "\[LongDash]" <> ToString[dns[[# + 2]]] & /@ SequencePosition[Differences[dns], {1, 1}][[All, 1]]
|
|
Multicolumn[triplets, {Automatic, 5}, Appearance -> "Horizontal"]
|