login
Indices in A339991 where records occur.
4

%I #12 Feb 13 2021 14:57:46

%S 1,2,3,5,7,11,19,29,39,53,61,73,79,101,149,229

%N Indices in A339991 where records occur.

%C The records in A339991 corresponding the first 16 terms in this sequence are 0, 1, 4, 8, 9, 15, 22, 23, 24, 31, 32, 71, 88, 99, 104, 9267.

%C A339991(397), which is > 249275, is still unknown.

%t With[{s = Array[-1 + Length@ NestWhileList[Which[EvenQ@ #, #/2, PrimeQ@ #, #^2 - 1, True, # - 1] &, #, # > 1 &] &, 396]}, Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* _Michael De Vlieger_, Feb 12 2021 *)

%o (Python)

%o from sympy import isprime

%o rec = -1

%o for n in range(1, 397):

%o m, ct = n, 0

%o while m > 1:

%o if m%2 == 0: m /= 2

%o elif isprime(m) == 1: m = m*m - 1

%o else: m -= 1

%o ct += 1

%o if ct > rec: print(n); rec = ct

%Y Cf. A339991, A340008, A060412 (Collatz record indices).

%K nonn,more

%O 1,2

%A _Ya-Ping Lu_, Jan 06 2021