< Back

Get-HailStoneSequence

Tue Jan 14, 2020 12:34 am

NAME Get-HailStoneSequence



SYNOPSIS

Returns the HailStone Sequence





SYNTAX

Get-HailStoneSequence [-StartingNumber] <Int64> [<CommonParameters>]





DESCRIPTION

Returns the HailStone Number Sequence, or Collatz conjecture. Wikipedia definition:

Start with any positive integer n. Then each term is obtained from the previous term as follows:

if the previous term is even, the next term is one half the previous term.

If the previous term is odd, the next term is 3 times the previous term plus 1.

The conjecture is that no matter what value of n, the sequence will always reach 1.





PARAMETERS

-StartingNumber <Int64>

Any positive interger to start the HailStone / Collatz conjecture.



Required? true

Position? 1

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS





RELATED LINKS