OFFSET
1,3
COMMENTS
If n is an odd prime, then a(n) = 2 and a(n+1) = n. All n for which a(n) = 2 are odd primes. - Robert Israel, Apr 14 2016
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 1 by definition.
a(2) = 1 because a(1) divides 2.
a(3) = 2 because a(2) divides 3.
a(4) = 3 because a(3) divides 4.
a(5) = 2 because a(2) divides 5.
a(6) = 5 because a(5) divides 6.
a(7) = 2 because a(2) divides 7.
a(8) = 7 because a(7) divides 8.
MAPLE
A:= proc(n) option remember; local m;
for m from n-1 by -1 do
if n mod A(m) = 0 then return m fi
od
end proc:
A(1):= 1:
seq(A(i), i=1..100); # Robert Israel, Apr 14 2016
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Block[{m = n - 1}, While[Mod[n, a[m]] > 0, m--]; m]; Array[a, 100] (* Giovanni Resta, Apr 14 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Apr 14 2016
STATUS
approved