

A271773


a(1) = 0, then a(n) is the maximum of all 0 < m < n for which n == a(m) (mod m).


2



0, 1, 2, 1, 4, 1, 6, 3, 5, 1, 10, 1, 12, 9, 2, 1, 16, 1, 18, 7, 11, 1, 22, 5, 13, 3, 20, 1, 28, 1, 30, 21, 17, 7, 8, 1, 36, 25, 5, 1, 40, 1, 42, 39, 23, 1, 46, 7, 16, 33, 14, 1, 52, 11, 48, 19, 29, 1, 58, 1, 60, 15, 38, 13, 54, 1, 66, 45, 7, 1, 70, 1, 72, 27
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


LINKS

Peter Kagey, Table of n, a(n) for n = 1..10000


EXAMPLE

a(1) = 0 by definition.
a(2) = 1 because a(1) == 2 (mod 1).
a(3) = 2 because a(2) == 3 (mod 2).
a(4) = 1 because a(1) == 4 (mod 1).
a(5) = 4 because a(4) == 5 (mod 4).
a(6) = 1 because a(1) == 6 (mod 1).
a(7) = 6 because a(6) == 7 (mod 6).
a(8) = 3 because a(3) == 8 (mod 3).


MATHEMATICA

a[1] = 0; a[n_] := a[n] = Max@ Select[Range[n  1], Mod[n, #] == Mod[a[#], #] &]; Table[a@ n, {n, 75}] (* Michael De Vlieger, Apr 15 2016 *)


CROSSREFS

Cf. A269423, A269427, A271530, A271531, A271774.
Sequence in context: A131755 A305812 A292403 * A277127 A118275 A243824
Adjacent sequences: A271770 A271771 A271772 * A271774 A271775 A271776


KEYWORD

nonn


AUTHOR

Peter Kagey, Apr 14 2016


STATUS

approved



