OFFSET

1,3

LINKS

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

EXAMPLE

a(1) = 1 by definition.

a(2) = 1, because 2 == a(1) (mod 1);

a(3) = 2, because 3 == a(1) (mod 1), and 3 == a(2) (mod 2): lcm(1, 2) = 2;

a(4) = 1, because 4 == a(1) (mod 1);

a(5) = 12, because 5 == k (mod k) for 0 < k < 5: lcm(1, 2, 3, 4) = 12.

PROG

(PARI) lista(nn) = {va = vector(nn); va[1] = 1; print1(va[1], ", "); for (n=2, nn, new = 1; for (k=1, n-1, if (Mod(va[k], k) == Mod(n, k), new = lcm(new, k); ); ); va[n] = new; print1(va[n], ", "); ); } \\ Michel Marcus, Mar 13 2018

CROSSREFS

KEYWORD

nonn

AUTHOR

Peter Kagey, Apr 09 2016

STATUS

approved