4 8% of the code blown away like dust in the wind
source | link

PowerShell Core, 91 101 10193 bytes

Function F($a){$o=$a*($a+1)/2;1..,2|%{$o=iex((iex$o=[char[]]"$($o-split''-ne''[char[]]"$o"-join'*')join'*'|iex)-split''-ne''"-join'+')join'+'|iex};$o}

Try it online!Try it online!

Ungolfed a little...

Function FooF ($a)
{
    $o=$a*($a+1)/2;
 
    1..2 | % {
        $o=iex ($o-split''-ne'' = [char[]]"$o"-join'*')
join '*' | iex;
     $o=iex (  $o-split''-ne'' = [char[]]"$o"-join'+')join '+' | iex;
    }
    $o | Write-Output
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of stringsstringscharacters. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < logloglog 100log 00010^6 < log 6 < 2, so that saved another six bytes.

Edit x2: @AdmBorkBork found a more terse way of converting the integer into a math expression, and then suggested piping it into iex. This saved 8 bytes. Thank you!

PowerShell Core, 91 101 bytes

Function F($a){$o=$a*($a+1)/2;1..2|%{$o=iex((iex($o-split''-ne''-join'*'))-split''-ne''-join'+')};$o}

Try it online!

Ungolfed a little...

Function Foo ($a)
{
    $o=$a*($a+1)/2;
 
    1..2 | % {
        $o=iex ($o-split''-ne''-join'*')
        $o=iex ($o-split''-ne''-join'+')
    }
    $o
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of strings. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < loglog 100 000 < 2, so that saved another six bytes.

PowerShell Core, 91 101 93 bytes

Function F($a){$o=$a*($a+1)/2;1,2|%{$o=[char[]]"$([char[]]"$o"-join'*'|iex)"-join'+'|iex};$o}

Try it online!

Ungolfed a little...

Function F ($a)
{
    $o=$a*($a+1)/2;
    1..2 | % {
        $o = [char[]]"$o"-join '*' | iex;
        $o = [char[]]"$o"-join '+' | iex;
    }
    $o | Write-Output
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of stringscharacters. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < log log 10^6 < log 6 < 2, so that saved another six bytes.

Edit x2: @AdmBorkBork found a more terse way of converting the integer into a math expression, and then suggested piping it into iex. This saved 8 bytes. Thank you!

3 Wrong link on the TIO. Argh.
source | link

PowerShell Core, 91 101 bytes

Function F($a){$o=$a*($a+1)/2;1..2|%{$o=iex((iex($o-split''-ne''-join'*'))-split''-ne''-join'+')};$o}

Try it online!Try it online!

Ungolfed a little...

Function Foo ($a)
{
    $o=$a*($a+1)/2;

    1..2 | % {
        $o=iex ($o-split''-ne''-join'*')
        $o=iex ($o-split''-ne''-join'+')
    }
    $o
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of strings. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < loglog 100 000 < 2, so that saved another six bytes.

PowerShell Core, 91 101 bytes

Function F($a){$o=$a*($a+1)/2;1..2|%{$o=iex((iex($o-split''-ne''-join'*'))-split''-ne''-join'+')};$o}

Try it online!

Ungolfed a little...

Function Foo ($a)
{
    $o=$a*($a+1)/2;

    1..2 | % {
        $o=iex ($o-split''-ne''-join'*')
        $o=iex ($o-split''-ne''-join'+')
    }
    $o
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of strings. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < loglog 100 000 < 2, so that saved another six bytes.

PowerShell Core, 91 101 bytes

Function F($a){$o=$a*($a+1)/2;1..2|%{$o=iex((iex($o-split''-ne''-join'*'))-split''-ne''-join'+')};$o}

Try it online!

Ungolfed a little...

Function Foo ($a)
{
    $o=$a*($a+1)/2;

    1..2 | % {
        $o=iex ($o-split''-ne''-join'*')
        $o=iex ($o-split''-ne''-join'+')
    }
    $o
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of strings. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < loglog 100 000 < 2, so that saved another six bytes.

2 Derped on the math.
source | link

PowerShell Core, 9191 101 bytes

Function F($a){$o=$a*($a+1)/2;WHILE(9-lt$o)2;1..2|%{$o=iex((iex($o-split''-ne''-join'*'))-split''-ne''-join'+')}$o;$o}

Try it online!Try it online!

Ungolfed a little...

Function Foo ($a)
{
    $o=$a*($a+1)/2; 

    WHILE(9-lt$o)
 1..2 | % {
        $o=iex ($o-split''-ne''-join'*')
        $o=iex ($o-split''-ne''-join'+')
    }
    $o
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of strings. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < loglog 100 000 < 2, so that saved another six bytes.

PowerShell Core, 91 bytes

$o=$a*($a+1)/2;WHILE(9-lt$o){$o=iex((iex($o-split''-ne''-join'*'))-split''-ne''-join'+')}$o

Try it online!

Ungolfed a little...

Function Foo ($a)
{
    $o=$a*($a+1)/2;
    WHILE(9-lt$o)
    {
        $o=iex ($o-split''-ne''-join'*')
        $o=iex ($o-split''-ne''-join'+')
    }
    $o
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of strings. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

PowerShell Core, 91 101 bytes

Function F($a){$o=$a*($a+1)/2;1..2|%{$o=iex((iex($o-split''-ne''-join'*'))-split''-ne''-join'+')};$o}

Try it online!

Ungolfed a little...

Function Foo ($a)
{
    $o=$a*($a+1)/2; 

    1..2 | % {
        $o=iex ($o-split''-ne''-join'*')
        $o=iex ($o-split''-ne''-join'+')
    }
    $o
}

First steps were to split the integers into digits -- did this by splitting the integer into an array of strings. Afterwards, insert the operand, and then evaluate the string as a command. Then, it's a matter of doing the multiple-add cycle until the input is one digit.

iex is an alias for Invoke-Command which evaluates a string passed into the first param position.

Edit: As requested by @AdmBorkBork, I have added a function header to the byte count. Also, I did a little math and realized that an upper bound on the number of iterations is < loglog 100 000 < 2, so that saved another six bytes.

1
source | link