cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A271531 a(1) = 1; thereafter a(n) is the LCM of all 0 < m < n for which n == a(m) (mod m).

Original entry on oeis.org

1, 1, 2, 1, 12, 1, 30, 3, 28, 9, 24, 5, 132, 3, 26, 7, 420, 1, 360, 3, 4, 5, 1680, 253, 84, 15, 440, 117, 1020, 7, 42, 15, 28, 725, 2376, 1, 47880, 3, 2960, 1, 29640, 155, 120, 21, 476, 11781, 11040, 1, 2640, 3, 1288, 5, 300, 13, 144, 285, 2860, 7, 4200, 1
Offset: 1

Views

Author

Peter Kagey, Apr 09 2016

Keywords

Examples

			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.
		

Programs

  • 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