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 A057689 #21 Dec 12 2023 08:42:07 %S A057689 16,66,50,672,20372,494,36918,1404,12210,4248,5070,1682,1850,2210, %T A057689 35882,102720,94484303672,30084,178992,5330,246560,6890,294253314, %U A057689 8416400,515202,134004,2810784,2810883506682183650,377198408,320168 %N A057689 Maximal term in trajectory of P under the 'Px+1' map, where P = n-th prime, or -1 if no such term exists. %C A057689 See A057684 for definition. %H A057689 Michael S. Branicky, <a href="/A057689/b057689.txt">Table of n, a(n) for n = 2..10001</a> (terms 2..1000 from T. D. Noe) %e A057689 For n=3, P=7: trajectory of 7 is 7, 50, 25, 5, 1, 8, 4, 2, 1, 8, 4, 2, 1, 8, 4, 2, 1, ..., which has maximal term 50, cycle length 4 and there are 4 terms before it enters the cycle. %t A057689 Px1[p_,n_]:=Catch[For[i=1,i<PrimePi[p],i++,If[Divisible[n,Prime[i]],Throw[n/Prime[i]]]];p*n+1]; %t A057689 With[{nmax=50},Table[Max[NestWhileList[Px1[Prime[n],#]&,Prime[n],UnsameQ,All]],{n,2,nmax}]] (* _Paolo Xausa_, Dec 11 2023 *) %o A057689 (Python) %o A057689 from sympy import prime, primerange %o A057689 def a(n): %o A057689 P = prime(n) %o A057689 x, plst, seen = P, list(primerange(2, P)), set() %o A057689 while x > 1 and x not in seen: %o A057689 seen.add(x) %o A057689 x = next((x//p for p in plst if x%p == 0), P*x+1) %o A057689 return max(seen) %o A057689 print([a(n) for n in range(2, 32)]) # _Michael S. Branicky_, Dec 11 2023 %Y A057689 Cf. A057446, A057216, A057522, A057534, A057614. See also A033478, A057688, A057684, A057685, A057686, A057687, A057690, A057691. %K A057689 nonn,nice,easy %O A057689 2,1 %A A057689 _N. J. A. Sloane_, Oct 20 2000 %E A057689 More terms from Larry Reeves (larryr(AT)acm.org), Nov 08 2000