OFFSET
0,2
COMMENTS
a(2) = 0 as there is no k > 0 such that A000217(k) is divisible by k+2 (Proof: Suppose a(2) = k > 0. Then z = (k*(k+1)/2)/(k+2) is an integer. Notice that z = (k*(k+1)/2)/(k+2) = (k-1)/2 + 1/(k+2). Let (k-1)/2 = m, 1/(k+2) = t. Since k-1 is an integer, either m or m + 1/2 is also an integer. Since z = m+t and z is an integer, either t or t + 1/2 is an integer. However, for any k > 0, we have t < 1/2 and t > 0, so neither t nor t + 1/2 is an integer, which is a contradiction. Hence, there is no k > 0 such that a(2) = k).
LINKS
Maciej Skrzypczak, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = Min_{k>0} (1/2) * (k-n+1+n*(n-1)/(k+n)) is an integer.
EXAMPLE
MATHEMATICA
a[2] = 0; a[n_] := Module[{k = 1}, While[!Divisible[k*(k + 1)/2, n + k], k++]; k]; Array[a, 68, 0] (* Amiram Eldar, Aug 08 2020 *)
PROG
(PARI) a(n) = {if (n!=2, my(k=1); while(k*(k+1)/2 % (n+k), k++); k); } \\ Michel Marcus, Jul 18 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Maciej Skrzypczak, Jul 17 2020
STATUS
approved