Magic popcount numbers
Python 2, 52 49 46 bytes
The kth number is given by 2**512/(2**2**k + 1)
. This is for a 512 bit number, so it's trivial to extend the pattern to different widths.
l=2;exec"print'0x%0128x'%(2**512/-~l);l*=l;"*9
3 bytes saved thanks to Dennis.
3 bytes saved thanks to xnor.
PHP, 111 110 108 bytes
One byte saved thanks to @user59178.
<?=($p=str_pad)("0x",130,5).$p($s="\n0x",131,3);for($x=1;$x<65;$x*=2)echo($p($s,131,$p(0,$x,0).$p(f,$x,f)));
What´s the pattern for 1024 bits? :D
Retina, 43 bytes
:`
0x128$*5
:`5
3
;{:`33
0f
0(f+)(0+)
0$2$1
Try it online!
Explanation
This makes a lot of use of the generally underused :
option which lets you print intermediate results, because it's a lot shorter to modify a single line than to build up the whole output.
:`
0x128$*5
This replaces the empty input with 0x
followed by 128 5
s and prints it to generate the first line.
:`5
3
This one replaces the 5
s with 3
s to generate the second line and prints it as well.
;{:`33
0f
This is the last special-cased line and it turns every two 3
s into 0f
to generate the third line. This also starts a loop through the last two stages ({
). However, this stage won't do anything after the first iteration except print the current state. The ;
suppresses the output at the very end of the program to avoid duplicating the last line.
0(f+)(0+)
0$2$1
This substitution now transforms each line into the next, by swapping every other pair of f
s and 0
s. The "every other pair" condition is enforced by matching a zero in front of the f
, which makes it impossible to match consecutive pairs since matches cannot overlap.