All pastes #237455 Raw Edit

7 moi

public text v1 · immutable
·published 2006-11-04 15:41 UTC
rendered paste body
#!/bin/sh

if test $# -ne 1
then
	echo "Usage: $0 <u0>"
	exit 1
fi

Uinit=$1

echo "val en arg"$Uinit

Usuiv=$Uinit

while test $Usuiv -ne 1 ; do
	Utest=`expr $Usuiv % 2`
	if test $Utest -eq 0 
		then
			Usuiv=$(( $Usuiv/2 ))
		else
			Usuiv=$(((3*$Usuiv)+1))
	fi
	echo -n $Usuiv " "
done

echo "fin"