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.
%I A122377 #21 Jun 05 2022 19:17:14 %S A122377 1,2,1,1,1,2,1,8,9,2,1,12,1,2,5,1,1,18,1,2,1,2,1,24,1,2,9,7,1,10,1,2, %T A122377 1,2,7,36,1,2,13,40,1,2,1,2,5,2,1,16,1,2,17,13,1,18,11,56,1,2,1,60,1, %U A122377 2,7,1,1,2,1,2,1,14,1,72,1,2,5,19,1,26,1,80,1,2,1,84,1,2,29,88,1,9,13,2,1,2 %N A122377 a(n) is the n-th term in periodic sequence repeating the divisors of n in increasing order. %C A122377 Old name: a(n) = m-th positive divisor of n, where d(n) is number of positive divisors of n and m = d(n) if d(n)|n, else m = n mod d(n). %H A122377 Alois P. Heinz, <a href="/A122377/b122377.txt">Table of n, a(n) for n = 1..20000</a> %e A122377 The divisors of 6 are 1, 2, 3, 6; repeating that produces the sequence 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, ...; the 6th term in that sequence is 2, so a(6) = 2. %p A122377 with(numtheory): %p A122377 a:= n-> (l-> l[1+irem(n-1, nops(l))])(sort([divisors(n)[]])): %p A122377 seq(a(n), n=1..100); # _Alois P. Heinz_, Jan 29 2018 %t A122377 f[n_] := Block[{d = Divisors[n]}, d[[Mod[n, Length[d], 1]]]];Table[f[n], {n, 100}] (* _Ray Chandler_, Oct 26 2006 *) %t A122377 Table[PadRight[{},n,Divisors[n]][[-1]],{n,100}] (* _Harvey P. Dale_, Jun 05 2022 *) %o A122377 (PARI) a(n) = my(d=divisors(n)); if (n % #d, d[n % #d], n); \\ _Michel Marcus_, Jan 26 2018 %Y A122377 Cf. A000005, A122383, A124332, A298734 (n/a(n)). %Y A122377 Cf. A033950 (fixed points). [From _Franklin T. Adams-Watters_, Jul 11 2009] %K A122377 nonn %O A122377 1,2 %A A122377 _Leroy Quet_, Oct 19 2006 %E A122377 Edited and extended by _Ray Chandler_, Oct 26 2006 %E A122377 New name from _Franklin T. Adams-Watters_, Jan 25 2018