login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of steps needed to reach 1 or to enter the cycle in the "sqrt(Pi)*x+1" problem.
1

%I #14 Mar 19 2024 17:23:23

%S 0,1,1,2,6,1,5,3,5,7,9,2,4,6,6,4,59,6,61,8,63,10,14,3,12,5,5,7,7,7,58,

%T 5,10,60,11,7,10,62,13,9,13,64,42,11,11,15,66,4,55,13,13,6,68,6,57,8,

%U 15,8,10,8,48,59,10,6,10,10,14,61,72,12,12,8,12,10

%N Number of steps needed to reach 1 or to enter the cycle in the "sqrt(Pi)*x+1" problem.

%C The sqrt(Pi)*x+1 problem is as follows: start with a number x. If x is even, divide it by 2, otherwise multiply it by sqrt(Pi) and add 1, and then take the integer part.

%C There are three possible behaviors for such trajectories when n>0:

%C (i) The trajectory reaches 1 (and enters the "trivial" cycle 2-1-2-1-2...).

%C (ii) Cyclic trajectory. The trajectory becomes periodic and the period does not contain a 1.

%C (iii) The trajectory is divergent (I conjecture that this cannot occur).

%C For many numbers, the element of the trivial cycle is 1, except for the numbers: 3, 6, 7, 12, 13, 14, 15, 23, 24, 26, 27, 28, 29, 30, 33, 35, 37, 39, 41, 46, 48, 52, 54, 56, 58, 59, 60, 63, ...

%H Michel Lagneau, <a href="/A265416/b265416.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) = 6 because 5 -> 9 -> 16 -> 8 -> 4 -> 2 -> 1 with 6 iterations where:

%e 5 -> floor(5*sqrt(Pi)+1) = 9;

%e 9 -> floor(9*sqrt(Pi)+1) = 16;

%e 16 -> 16/2 = 8 -> 8/2 = 4 -> 4/2 = 2 -> 2/2 = 1, the end of the cycle.

%e a(6) = 1 because 6 -> 3 with 1 iteration where:

%e 6 -> 3;

%e 3 -> floor(3*sqrt(Pi)+1) = 6, the end of the cycle.

%p A265416:= proc(n)

%p local cyc, x;

%p x := n;

%p cyc := {x} ;

%p for s from 0 do

%p if {1} intersect cyc = {1} then

%p return s;

%p end if;

%p if type(x, 'even') then

%p x := x/2 ;

%p else

%p x := floor(evalf(sqrt(Pi))*x+1) ;

%p end if;

%p if {x} intersect cyc = {x} and s > 0 then

%p return s;

%p end if;

%p cyc := cyc union {x} ;

%p end do:

%p end proc: # Program from R.J. Mathar adapted for this sequence - see A264789.

%t Table[Length@ NestWhileList[If[EvenQ@ #, #/2, Floor[# Sqrt@ Pi + 1]] &, n, UnsameQ, All] - 2, {n, 0, 72}] (* Program from Michael De Vlieger adapted for this sequence - see A264789 *).

%Y Cf. A006577, A264789.

%K nonn

%O 1,4

%A _Michel Lagneau_, Dec 08 2015