OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
It appears that a(n+98) = a(n)+420 for n >= 9. - Robert Israel, Oct 19 2021
MAPLE
f:= proc(n) local k, c;
c:= 0:
for k from 2 do
if n mod k <> 0 then
if c = 1 then return n+k fi;
c:= 1;
fi
od
end proc:
R:= 5: t:= 5:
for count from 2 to 100 do
t:= f(t);
R:= R, t;
od:
R; # Robert Israel, Oct 19 2021
MATHEMATICA
a = {5}; Do[AppendTo[a, a[[ -1]] + Select[Range[a[[ -1]]], Mod[a[[ -1]], # ] > 0 &][[2]]], {60}]; a (* Stefan Steinerberger, Jul 01 2008 *)
PROG
(Python)
def aupton(terms):
alst = [5]
while len(alst) < terms:
an, k, smallest = alst[-1], 2, False
while not smallest or an%k == 0:
if not smallest and an%k != 0: smallest = True
k += 1
alst.append(an+k)
return alst
print(aupton(58)) # Michael S. Branicky, Oct 19 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini, Jun 25 2008
EXTENSIONS
Corrected and extended by Stefan Steinerberger, Jul 01 2008
STATUS
approved