close
login
A391055
a(n) is the number of iterations of x-> gpf(3*x+1) starting at n until the value 2 is reached; a(n) = -1 if 2 is not reached.
3
1, 0, 2, 3, 1, 7, 5, 2, 6, 11, 4, 7, 2, 4, 7, 6, 3, 5, 6, 8, 1, 9, 6, 6, 7, 5, 12, 4, 5, 3, 10, 7, 2, 12, 3, 13, 6, 7, 11, 5, 11, 14, 3, 7, 4, 8, 9, 6, 7, 13, 5, 12, 2, 7, 3, 3, 4, 6, 10, 5, 7, 4, 7, 7, 6, 8, 8, 12, 3, 6, 8, 11, 5, 10, 5, 5, 6, 10, 4, 6, 8, 7, 2
OFFSET
1,3
COMMENTS
Conjecture: a(n) is never equal to -1.
EXAMPLE
Irregular array n\ iterations gpf(3n+1):
1: 2, so a(1) = 1.
2: already 2, so a(2) = 0.
3: 5, 2, so a(3) = 2.
4: 13, 5, 2, so a(4) = 3.
5: 2, so a(5) = 1.
6: 19, 29, 11, 17, 13, 5, 2, so a(6) = 7.
7: 11, 17, 13, 5, 2, so a(7) = 5.
8: 5, 2, so a(8) = 2.
9: 7, 11, 17, 13, 5, 2, so a(9) = 6.
10: 31, 47, 71, 107, 23, 7, 11, 17, 13, 5, 2, so a(10) = 11.
11: 17, 13, 5, 2, so a(11) = 4.
12: 37, 7, 11, 17, 13, 5, 2, so a(12) = 7.
13: 5, 2, so a(13) = 2.
14: 43, 13, 5, 2, so a(14) = 4.
15: 23, 7, 11, 17, 13, 5, 2, so a(15) = 7.
MAPLE
a:= proc(n) option remember;
`if`(n=2, 0, a(max(ifactors(3*n+1)[2][.., 1]))+1)
end:
seq(a(n), n=1..83); # Alois P. Heinz, Nov 26 2025
MATHEMATICA
a[n_] := -1 + Length@ NestWhileList[FactorInteger[3*# + 1][[-1, 1]] &, n, # != 2 &]; Array[a, 100] (* Amiram Eldar, Nov 26 2025 *)
PROG
(PARI) a(n) = my(nb=0); while(n!=2, nb++; n=vecmax(factor(3*n+1)[, 1])); nb;
(Python)
from sympy import factorint
from functools import cache
@cache
def a(n): return 0 if n == 2 else 1 + a(max(factorint(3*n+1)))
print([a(n) for n in range(1, 84)]) # Michael S. Branicky, Dec 04 2025
CROSSREFS
Sequence in context: A114581 A328398 A085588 * A377345 A118008 A256045
KEYWORD
nonn
AUTHOR
Alain Rocchelli, Nov 26 2025
STATUS
approved