last day (15 days later) » 

09:21
Anyone want to write a program for this...? — greenturtle3141 Jan 23, 2017 at 6:19
Good
7
A: Most consecutive positive integers using two 1s

boboquackLet's try (feel free to add on or correct, this is community wiki):

I think the fourth generation of golfing lanaguges is not gonna be human-readable
i mean, i think simp wouldn't be human readable
@Nobody In theory, you can create any amount with two 1s
Factorial increases, sqrt decreases
well,
I have a book somewhere with expressions for 15-17
09:23
try prove the Colatz Conjecture
Collatz
I understand your point, but it seems like a reasonable assumption
it's like, say one of them is +2 and the other is -2 you are not getting from 1 to 2
I see your poiint
It wouldn't be hard - simply take the factorials of every number from 1-10000 (probably memoizing) and for each, take the sqrt until it is <2 and jot down intermediate values
erm wdym
specifically
> jot down intermediate values
Anyone want to program that?
Take the square root and append it to a list of numbers you've got by sqrting so far
09:27
erm, so
start with say [3]
and then
l+=[sqrt(factorial(i)) for i in l]
Pretty much, you can use some sort of tree search to get values
More:
arr = []
for i in 10000:
 i = factorial(i)
 a = []
 while i < 2
  i = sqrt(i)
  a.push(ceil(i))
  a.push(floor(i))
 arr.push(a)
Except you'd want to use an accumulator to speed up factorial calculation
Initial attempt
l=[11] # Initial Setup
def f(x): return 1 if x<2 else x*f(x-1)
# factorial
def s(x): return int(x**0.5)
# square root
for i in range(1001): # repeat 1000 times here
    l += list(map(f, l))
    l += list(map(s, l))
    l =  sorted(list(set(l))) # clear duplicates and sort
    print(l) # report

[3, 11, 6317, 39916800]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3444, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
35 messages moved from The Nineteenth Byte
So... use a loop to calculate the factorial
a = 1
for i in range(1, 10001):
 a *= i
 b = a
 # Do stuff with factorial
09:36
ok...
this is my current code
l=[11] # Initial Setup
from math import factorial as f
def s(x): return int(x**0.5)    # square root
def small(x): return x<10001    # Don't get too big and waste time

for i in range(1001): # repeat 1000 times here
    l += list(map(f, l))
    l =  list(filter(small, sorted(list(set(l))))) # clear duplicates and sort
    l += list(map(s, l))
    l =  list(filter(small, sorted(list(set(l))))) # clear duplicates and sort
    print(l) # report
guess the output
;-)
You want to clearly link each number to its factorial's sqrts
well the problem is
This code
l=[11] # Initial Setup

from math import factorial as f
def square(x):
    # is x a perfect square?
    possible_squareroots = [s(x)+i for i in range(-3,4)]
    return x in [z**2 for z in possible_squareroots]
def s(x): return int(x**0.5)    # square root
def S(x): return s(x) if square(x) else 1+s(x)
def small(x): return x<100001    # Don't get too big and waste time

for i in range(1001): # repeat 1000 times here
    l += list(map(f, l))
    l =  list(filter(small, sorted(list(set(l))))) # clear duplicates and sort
ended up with this
[1, 2, 3, 4, 5, 6, 10, 11, 24, 26, 27, 120, 720]
oh no
One moment
10:03
back from lunch in china
10:42
@emanresuA What do say this line mean
10 [1904, 1905, 43, 44, 6, 7, 2, 3]
It means you can produce those numbers from 10 through sqrts and factorials (I think)
what do you mean youthink
@emanresuA .
maybe we can change factorial into 2^n
should be easier to calc
@emanresuA .
11:17
No because the only operators you can apply are factorial and sqrt
It's not a simple bruteforce
o/

last day (15 days later) »