Thread: An unreasonable operation View Single Post
2020-02-10, 03:00   #4
CRGreathouse

Aug 2006

3·1,993 Posts

Quote:
 Originally Posted by fivemack Prove there is no integer for which n, 2n, 4n, ..., (2^20)n all have no 0 in their decimal expansion
Nicely done.

Quote:
 Originally Posted by fivemack Find an integer for which n, 2n, 4n, ..., (2^19)n all have no 0 in their decimal expansion
I believe 348612479 will do. My search code:

Code:
has(n)=vecmin(digits(n))>0
is(n)=for(k=1,19,if(!has(n<<k),return(0)));1
for(N=1,9^8, n=fromdigits(digits(N,9)); k=n%10; if((k==2||k==7) && is(10*n+9), return(10*n+9)))
No doubt this could have been done more efficiently.