All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Terminating in seven sevens (Posted on 2009-06-26)
Determine the minimum value of a positive base ten integer N, such that each of the last seven digits of N3 is 7 but the eighth digit from the right in N3 is not 7.

 See The Solution Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2

This program takes a couple of minutes to run and doesn't produce any results:

`10   for N1=1 to 100000000020          if N@10<>7 then30           :N=N1*10000000+777777740           :Cr=int(N^(1/3)+0.5)50           :if Cr*Cr*Cr=N then print N60   next`
` `

The more efficient program below produces results in a couple of seconds, as treating only cubes goes faster than looking at many numbers in search of a cube:

`10   for N=999 to 99999999920    C=N*N*N30    if C@10000000=7777777 then40      :if C@100000000<>77777777 then print N,C50   next`

It produces

9660753         901639512372747777777
19660753        7599769868183017777777
29660753        26094352023993287777777
39660753        62385385979803557777777
49660753        122472871735613827777777
59660753        212356809291424097777777
69660753        338037198647234367777777
79660753        505514039803044637777777
89660753        720787332758854907777777
109660753       1318723274070475447777777
119660753       1713385922426285717777777
129660753       2179845022582095987777777

before being stopped manually.

It shows N=9660753, whose cube is 901639512372747777777, as the minimum value.

A run of the below program:

`10   for N=999 to 99999999920    C=N*N*N30    if C@10000000=7777777 then40      :print N,C50   next`

shows that the caveat of the eighth digit from the right not being 7 was unnecessary, as such a cube with 8 7's at the end comes much higher:

`9660753         90163951237274777777719660753        759976986818301777777729660753        2609435202399328777777739660753        6238538597980355777777749660753        12247287173561382777777759660753        21235680929142409777777769660753        33803719864723436777777779660753        50551403980304463777777789660753        72078733275885490777777799660753        989857077514665177777777109660753       1318723274070475447777777119660753       1713385922426285717777777129660753       2179845022582095987777777`

 Posted by Charlie on 2009-06-26 13:54:27

 Search: Search body:
Forums (0)