login
If a(n) is prime then a(n+1) = a(n)^2+9, otherwise a(n+1) = floor(a(n)/2), with a(1) = 2.
1

%I #30 Apr 23 2019 23:52:37

%S 2,13,178,89,7930,3965,1982,991,982090,491045,245522,122761,

%T 15070263130,7535131565,3767565782,1883782891,941891445,470945722,

%U 235472861,117736430,58868215,29434107,14717053,7358526,3679263,1839631

%N If a(n) is prime then a(n+1) = a(n)^2+9, otherwise a(n+1) = floor(a(n)/2), with a(1) = 2.

%C Question: does this sequence reach a cycle or does it increase without bound?

%C No cycle occurs in the first 324000 terms.

%H Robert Israel, <a href="/A307655/b307655.txt">Table of n, a(n) for n = 1..6630</a>

%H dxdy forum, <a href="https://dxdy.ru/topic133650.html">post</a> (in Russian).

%H Carlos Rivera, <a href="https://www.primepuzzles.net/puzzles/puzz_949.htm">Puzzle 949. Another Collatz-like sequence</a>

%t Nest[Append[#, If[PrimeQ@ #[[-1]], #[[-1]]^2 + 9, Floor[#[[-1]]/2] ]] &, {2}, 25] (* _Michael De Vlieger_, Apr 21 2019 *)

%o (PARI) terms(n) = my(x=2, i=0); while(i < n, print1(x, ", "); i++; if(ispseudoprime(x), x=x^2+9, x=floor(x/2)))

%o /* Print initial 30 terms as follows: */

%o terms(30) \\ _Felix Fröhlich_, Apr 20 2019

%K nonn,look

%O 1,1

%A _Dmitry Kamenetsky_, Apr 20 2019