A334882 Numbers k such that k and k+2 are both primitive practical numbers (A267124).
28, 304, 306, 340, 460, 462, 858, 868, 1482, 1768, 1974, 2440, 2728, 2838, 2860, 3318, 3738, 4134, 4264, 4288, 4420, 4422, 5236, 5694, 6100, 6102, 7590, 8814, 9040, 9042, 10218, 11128, 11620, 11778, 12558, 12978, 13110, 14320, 14382, 14670, 15568, 16048, 16110
Offset: 1
Keywords
Examples
28 is a term since 28 and 28 + 2 = 30 are both primitive practical numbers.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
f[p_, e_] := (p^(e + 1) - 1)/(p - 1); pracQ[fct_] := (ind = Position[fct[[;; , 1]]/(1 + FoldList[Times, 1, f @@@ Most@fct]), ?(# > 1 &)]) == {}; pracTestQ[fct, k_] := Module[{f = fct}, f[[k, 2]] -= 1; pracQ[f]]; primPracQ[n_] := Module[{fct = FactorInteger[n]}, pracQ[fct] && AllTrue[Range@Length[fct], fct[[#, 2]] == 1 || ! pracTestQ[fct, #] &]]; Select[Range[2, 16200, 2], primPracQ[#] && primPracQ[# + 2] &]
Comments