Turtle Posted January 11, 2011 Report Posted January 11, 2011 i wanted to apologize for my previous post, it was hasty and bad form.anyway here's my newest aproach.snip...this takes 4 seconds to run, making it my fastest program yet. the obvious downside is that it can't be extended to larger values as the array is limited in size. or can it? here's my idea. calculate intermediate values and store them in an array, clearing the array once in a while. so here's what i would need from you guys. (for some reason i can't think striaght right now.) say i go to 100, then for each rank i want the next number above 100. what would be the formula for that, in terms if row, column and inc?for example, 102 would be the next figurate rank 3 row 6 column 3, 106 would be the next figurate rank 4 row 10 column 6, 105 would be the next figurate rank 5 row 15 column 10, etc. i understood it just fine. in short, there is no formula (known). i have taken my list table of figurate numbers that i earlier attached for you and added some indicators for clarification. the red line bounds all values less than 100, the green line bounds all values less than 200. notice they don't match. draw in as many bounds as you like, but they will just get longer & more convoluted and they won't match. no formula, no expression, no shortcut. in my humble opinion of course. Edit: i edited the table and added the bounds for <300=Yellow:<400=Blue:<500=magenta Quote
Don Blazys Posted January 12, 2011 Author Report Posted January 12, 2011 Are these fast enough for our purposes? http://www.liquidnitrogenoverclocking.com/shop_systems_economical.shtml don. Quote
modest Posted January 12, 2011 Report Posted January 12, 2011 the obvious downside is that it can't be extended to larger values as the array is limited in size. I don't think arrays in python have a size limit. Are you getting an out of memory error? Also, I'm curious, how big can you make an array, array = list(range(1,max,1)), without doing anything to it? If you can make it large, ~ max = 10**13, then I would have a solution I think. ~modest Quote
phillip1882 Posted January 12, 2011 Report Posted January 12, 2011 i don't think arrays in python have a size limit. Are you getting an out of memory error? Also, I'm curious, how big can you make an array, array = list(range(1,max,1)), without doing anything to it? If you can make it large, ~ max = 10**13, then I would have a solution I think. ~modestthey do have a size limit. on a 32 bit machine, an array is limited to 2^(32-3) elements (roughly 537 million). 64 bit machines python allows pretty much up to however muc hyour system can handle in ram. (up to 2^(64-3) or 2.3*10^18) Quote
phillip1882 Posted January 12, 2011 Report Posted January 12, 2011 okay here is my code; i need some help with it: import time, math t0 = time.time() finish = 10**3+1 max = 10**2 current = max+1 row = 10 column = 6 inc = 4 total = 0 array = list(range(6,max,3)) check = False file = open("numbers.txt","w") while column+inc < finish: if column+inc > current: array.sort() total += 1 file.write(str(total)+" "+str(array[0]) +"\n") for i in range(1,len(array)): if array[i] != array[i-1]: total += 1 file.write(str(total)+" "+str(array[i]) +"\n") array = list(range(3*(int(current/3)+1),current+max,3)) current += max column = 6 inc = 4 row = column*int((current-max-(column+inc))/column +1)+column+inc check = True else: if check: array += list(range(row,current,column)) column += inc inc += 1 row = column*int((current-max-(column+inc))/column +1)+column+inc if inc %3 == 0: column += inc inc += 1 row = column*int((current-max-(column+inc))/column +1)+column+inc else: array += list(range(row,current,column)) column = row inc += 1 row += inc if inc%3 == 0: column = row inc += 1 row += inc array.sort() total +=1 file.write(str(total)+" "+str(array[0]) +"\n") for i in range(1,len(array)): if array[i] != array[i-1]: total += 1 file.write(str(total)+" "+str(array[i]) +"\n") t0 =time.time()-t0 print(total,t0) i am missing 3 values, 201, 301, and 501. not sure why. Quote
phillip1882 Posted January 12, 2011 Report Posted January 12, 2011 okay i found the bug and fixed it. now I get the exact values up to 10^9. time? 8 1/2 minutes. i think im ready to break donks record. 10^13 should take 58 days. much more reasonable. Quote
Don Blazys Posted January 13, 2011 Author Report Posted January 13, 2011 I'm speechless! Don :thumbs_up Quote
Don Blazys Posted January 13, 2011 Author Report Posted January 13, 2011 When you get to [math]\varpi(10^{12})[/math], can you start posting your results in increments of one hundred billion as follows: _______[math]x[/math]______________________[math]\varpi(x)[/math]_____________ 1,000,000,000,000________________?_________________1,100,000,000,000________________?_________________1,200,000,000,000________________?_________________1,300,000,000,000________________?_________________ and so on? Meanwhile, I will calculate the expected values based on the lower and upper bounds of the fine structure constant and theproton to electron mass ratio, given by Wikipedia as follows: [math]137.035999135^{-1}[/math] to [math]137.035999033^{-1}[/math] [math]1836.15267167[/math] to [math]1836.15267327[/math] That way, we will be able to see new results on a daily basis! Exellent work!!! Don. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.