Here goes some ugly code!
f=a=>{p=parseInt,l=(''+a).length,i=0,r=[a];while(i<l){r.push(...[('0'+(p(a)-(10**i))).slice(-l),''+(p(a)+(10**i))]);++i}return r}
It works like that:
f('5555555555').join('\n'); "5555555555 5555555554 5555555556 5555555545 5555555565 5555555455 5555555655 5555554555 5555556555 5555545555 5555565555 5555455555 5555655555 5554555555 5556555555 5545555555 5565555555 5455555555 5655555555 4555555555 6555555555"
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here goes some ugly code!
It works like that: