OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
J. S. Myers, R. Schroeppel, S. R. Shannon, N. J. A. Sloane, and P. Zimmermann, Three Cousins of Recaman's Sequence, arXiv:2004:14000 [math.NT], April 2020.
MAPLE
f:= proc(n) local k, p;
p:= n;
for k from 1 do
p:= p*(n+k);
if (p/(n+k+1))::integer then return n+k+1 fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Feb 25 2020
MATHEMATICA
a[n_] := Module[{k, p = n}, For[k = 1, True, k++, p *= (n+k); If[Divisible[p, n+k+1], Return[n+k+1]]]];
Array[a, 100] (* Jean-François Alcover, Jul 18 2020, after Maple *)
PROG
(Python)
def a(n):
k, p = 1, n*(n+1)
while p%(n+k+1): k += 1; p *= (n+k)
return n + k + 1
print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Jun 06 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon and N. J. A. Sloane, Feb 24 2020
STATUS
approved