Continuously expanding code Your job is to write a program that rewrites and makes itself longer on each run of the program.

Challenge

The program will print Hello, World!\n (\n denotes a newline). Then, it will modify its own file so that the new program length is exactly 2x the length at runtime. This modified file when run, will print Hello, World!\nHello, World!\n. When run a third time, the file will print Hello, World!\nHello, World!\nHello, World!\nHello, World!\n.

More simply, on the nth run of the program, it will output 2^(n-1) instances of Hello, World!\n, and have a program length of 2^(n-1) the length of the original.

This is code-golf, so shortest code (before first run) wins. Please comment if you need something is not clear.

Edit: To get past the restriction of file-rewriting, your program may print the modified source along with the Hello, World!\ns at a +40% penalty.
PHP, 100

More efficient, 101

&lt;?$a=$argv[0];$b=file_get_contents($a);file_put_contents($a,$b.substr($b,81,20));echo"Hello World\n";


This script is appending an echo"Hello World";, but because you said the size should also vary, and because it's shorter, I'm also having this script:

Shorter, 100

&lt;?$a=$argv[0];$b=file_get_contents($a);file_put_contents($a,$b.substr($b,2,98));echo"Hello World\n";


This script is appending itself, in a way it adds one Hello World, but this version will overall take more space and takes longer to execute.

Example

But the scripts don't vary when it comes to the output:

root@raspberrypi:~/stack# php hello_expand.php
Hello World
root@raspberrypi:~/stack# php hello_expand.php
Hello World
Hello World
root@raspberrypi:~/stack# php hello_expand.php
Hello World
Hello World
Hello World