Self-Trapping Random Walks on Integer Lattices

Description of the Problem

The walker starts from the origin (0,0),(0,0,0),(0,0,0,0) in 2D, 3D, 4D. He tries one of the possible 2*d directions (+/-) along the coordinate axes with equal probability. If the target location of this trial step has been already visited before (including the start point), then a failed attempt is counted and another random choice out of the 2*d possible directions is made. This is repeated until a target location not visited before is found. This is counted as a successful step. If the current position is surrounded by 2*d already visited lattice points, then the walker is trapped and the walk is terminated. There are some characteristic numbers describing the path: Here is an example of a very long 2D walk.
Probability distribution of the number of steps before termination for the 2D walk.