A287142 Least k such that the number of pairs of consecutive divisors of k equals n.
1, 2, 6, 12, 72, 60, 180, 360, 420, 840, 1260, 3780, 2520, 5040, 13860, 36960, 41580, 27720, 55440, 83160, 166320, 277200, 491400, 471240, 360360, 1113840, 720720, 1081080, 3341520, 2162160, 2827440, 5405400, 4324320, 12972960, 6126120, 16576560, 28274400
Offset: 0
Keywords
Examples
a(3) = 12 because the divisors of 12 are {1, 2, 3, 4, 6, 12} with three pairs of consecutive divisors (1, 2), (2, 3) and (3, 4).
Programs
-
Maple
with(numtheory): for n from 0 to 60 do: ii:=0: for k from 1 to 10^8 while(ii=0) do: d0:=divisors(k):n0:=nops(d0):c0:=0: for i from 1 to n0-1 do: if d0[i+1]=d0[i]+1 then c0:=c0+1: else fi: od: if c0=n then ii:=1:printf(ā%d %d \nā,n,k): else fi: od: od:
-
Mathematica
Function[s, Function[t, ReplacePart[t, Map[#1 -> #2 & @@ # &, Transpose@{1 + Keys@ s, Values[s][[All, 1]]}]]]@ ConstantArray[0, Max@ Keys@ s]]@ KeySort@ PositionIndex@ Table[DivisorSum[n, 1 &, Divisible[n, # + 1] &], {n, 2 * 10^6}] (* Michael De Vlieger, May 20 2017, Version 10 *)
-
PARI
isok(n,k) = {dk = divisors(k); ddk = vector(#dk-1, j, dk[j+1] - dk[j]); #select(x->x==1, ddk) == n;} a(n) = {my(k=1); while (!isok(n, k), k++); k;} \\ Michel Marcus, May 20 2017
Formula
a(n) = 2*A130317(n) for n >= 1. - Bernard Schott, Jul 30 2022
Comments