A387654 Numbers k such that each of k and k+1 is either a practical number (A005153) or an almost practical number (A174533).
1, 4095, 5775, 5984, 11024, 21735, 21944, 26144, 39375, 49664, 58695, 61424, 69615, 76544, 79695, 89775, 91664, 98175, 104895, 106784, 111824, 116655, 116864, 121904, 134504, 135135, 144584, 152775, 155295, 160544, 165375, 170624, 174824, 180495, 185535, 192464
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..344
Programs
-
Mathematica
q[n_] := q[n] = Module[{d = Divisors[n], c, x}, c = CoefficientList[Product[1 + x^i, {i, d}], x]; MemberQ[{0, 2}, Total[d] - Count[Rest[c], _?(# > 0 &)]]]; Select[Range[40000], q[#] && q[#+1] &] (* warning: a slow program *)
-
PARI
isp(k) = {my(d = divisors(k), nd = #d, s = vecsum(d), p = prod(i = 1, nd, 1 + 'x^d[i])); abs(#select(x -> x > 0, Col(p)) - s) == 1;} list(kmax) = {my(is1 = 1, is2); for(k = 2, kmax, is2 = isp(k); if(is1 && is2, print1(k-1, ", ")); is1 = is2);} \\ warning: a slow program
Comments