login
A057689
Maximal term in trajectory of P under the 'Px+1' map, where P = n-th prime, or -1 if no such term exists.
11
16, 66, 50, 672, 20372, 494, 36918, 1404, 12210, 4248, 5070, 1682, 1850, 2210, 35882, 102720, 94484303672, 30084, 178992, 5330, 246560, 6890, 294253314, 8416400, 515202, 134004, 2810784, 2810883506682183650, 377198408, 320168, 3742442930913284, 257150
OFFSET
2,1
COMMENTS
The 'Px+1' map is: x -> (x/p if p = least prime factor(x) < P, else P*x + 1).
LINKS
Michael S. Branicky, Table of n, a(n) for n = 2..10001 (terms 2..1000 from T. D. Noe)
EXAMPLE
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.
MATHEMATICA
Px1[p_, n_]:=Catch[For[i=1, i<PrimePi[p], i++, If[Divisible[n, Prime[i]], Throw[n/Prime[i]]]]; p*n+1];
With[{nmax=50}, Table[Max[NestWhileList[Px1[Prime[n], #]&, Prime[n], UnsameQ, All]], {n, 2, nmax}]] (* Paolo Xausa, Dec 11 2023 *)
PROG
(Python)
from sympy import prime, primerange
def a(n):
P = prime(n)
x, plst, seen = P, list(primerange(2, P)), set()
while x > 1 and x not in seen:
seen.add(x)
x = next((x//p for p in plst if x%p == 0), P*x+1)
return max(seen)
print([a(n) for n in range(2, 32)]) # Michael S. Branicky, Dec 11 2023
(PARI) apply( {A057689(n)=my(m=oo, p=n=prime(n), M=n); until(n==m, if(n<m, m=n, n>M, M=n); forprime(q=2, p-1, if(n%q==0, n\=q; next(2))); n=n*p+1); M}, [2..33]) \\ M. F. Hasler, Feb 13 2026
CROSSREFS
Cf. A057690, A057691 (cycle and transition length for Px+1).
Cf. A033478, A057688, A057684, A057685, A057686, A057687 (trajectory of P under Px+1 for P = 3, 5, 13, 19, 23, 29).
Cf. A057614, A057522, A057446, A057534, A057216 (other trajectories under 11x+1, 13x+1 and 17x+1).
Cf. A020639 (least prime factor).
Sequence in context: A119285 A253673 A041494 * A045024 A043153 A039330
KEYWORD
nonn,nice
AUTHOR
N. J. A. Sloane, Oct 20 2000
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Nov 08 2000
STATUS
approved