---
# System prepended metadata

title: Untitled

---

```
import math

def gauss(r):
	return math.floor(r)

def sgn(r):
	return (
		(-1) if r < 0 else (1 if r > 0 else 0)
	)

def sin(r):
	return math.sin(r)

def cos(r):
	return math.cos(r)

def tan(r):
    return math.tan(r)

def root(r):
	return math.sqrt(r)

N = 1000000
is_prime = [True for _ in range(N)]
primes = []
for i in range(2,10000):
    if is_prime[i]:
        primes.append(i)
        for j in range(1000):
            if i * j >= N:
                break
            is_prime[i * j] = False

def prime(n):
    return primes[n-1]

pi = math.pi

def circle(n): # Good
	if n == 1:
		return 4092
	return abs(gauss(circle_c(n-1))) + gauss(n/21) / 9 

def circle_c(n): # Good
	return (
	0.168233053322 * n ** 6
	- 7.716955395795 * n ** 5
	+ 135.101190948602 * n ** 4 
	- 1151.15807397959 * n ** 3
	+ 4986.98572751322 * n ** 2 
	- 10322.1000355596 * n 
	+ 8390.09
	)

def empty(n):
	if n == 1:
		return 600
	return (
		abs(240 * delta_big(n-1) + 1000 * asterisc(n-1)) + 
		abs(sgn(n-12)) - 1
	)

def yen(n):
	if n == 1:
		return 6
	return (
		natural(n-1) + 2 * n + 4
		+ 110 * gauss(n/10) + 1/10 * gauss(n/17)
	)

def delta_big(n):
	return (
		(-1) ** gauss(n/2) * (sin((n+1) * pi / 2 - pi / 3) ** 4)
		+ gauss((n + 1) / 11)
		- gauss((n + 1) / 12)
	)

def page(n):
	if n == 1:
		return 437 / 45
	return (
		yen(n-1) / 9 + 48/(5 * n)
	)

def star(n):
	return (
		200 * gauss(n/4)
		- 100 * gauss(n/8)
		- 3200 * gauss(n/12)
		- 5115 * gauss(n/16)
		+ 1805 * gauss(n/20)
		+ 1805 / 29 * gauss(n/22)
		-350
	)

def dagger(n): # Good
	return 3/7 * gauss(n/13) + 1/8 * gauss(n/27) + 38/7

def dell(n): # Good
    return (
        -40.575 * n ** 5 + 1564.925 * n ** 4 - 23679.1083333333 * n ** 3
+ 175693.575 * n ** 2 - 639099.816666667 * n + 912001.5
    )

def delta_small(n): # Good
    if n == 1:
        return 371
    return (
        -gauss(20 * tan(n * pi / 20 - 10 * pi / 41))
        + ae(n-1) - abs(sgn(n-13))
        + abs(sgn(n-19))
        + 7 * n + 350
    )

def alpha(n):
    return (
        (abs(gauss(section(n)-1/10)) % 10000)
        + 1/3 * gauss(n/20)
    )

def ae(n): # Good
    return (
        -95 * gauss(n/5)
        + 106 * gauss(n/13)
        + 210 * gauss(n/15)
        - 6 * gauss(n/23)
        - 660 * gauss(n/38) - 60
    )

def eps(n): # Good
    if n == 1:
        return 23718902
    return (
        abs(
        	gauss(heart(n-1)) + 
            1/7 * gauss(n/21)
        )
    )

def crab(n):
    return prime(n)/100

def asterisc(n):
    return 1 / 1000 * (
        86 * gauss(n/4)
        - 43 * gauss(n/8)
        - 278 * gauss(n/12)
        - 56 * gauss(n/16)
        + 16 * gauss(n/20)
        + 120 * gauss(n/24)
        + 1/2 * gauss((n+1)/26)
        + 200
    )

def question(n): # Good
    if n == 1:
        return 414
    return 1/12*(
        754
        - 162 * cos(n*pi)
        + 42 * root(3) * sin(2*n*pi/3)
        - 526 * cos(2 * n * pi / 3)
        + 1062 * root(3) / 3 * sin(n * pi / 3)
        + 390 * cos(n*pi/3)
    ) + 100 * spade(n-1)

def psi(n):
    return (
    	1/24*(
        	12558 - 994 * cos(n * pi)
        	+ 2238 * root(3) / 3 * sin(2*n*pi/3)
        	- 210 * cos(2*n*pi/3)
        	+ 9414*root(3)/3*sin(n*pi/3)
        	+1186*cos(n*pi/3)
    	)
    + 1/24* sgn(sin((2*n-1)*pi/12)) * (
        2314
        -1374*cos(n*pi)
        +4578*root(3)/3*sin(2*n*pi/3)
        -3958*cos(2*n*pi/3)
        +12714*root(3)/3*sin(n*pi/3)
        -6042*cos(n*pi/3)
    )
    + 300 * gauss(n/13)
    + 52/5*gauss(n/20)
    + abs(sgn(n-8)) - 1
)

def pond(n): # Good
    if n == 1:
        return 912001
    return (
        (abs(gauss(dell(n-1)-1/2)) % 10000)
        + 1/2 * gauss(n/24)
    )

def ce(n):
    if n == 1:
        return 400
    return(
        dia(n-1)
        - star(n-1)
        + 50
    )

def spade(n): # Good
    return (
        -1.89 * gauss(n/6)
        + 0.74 * gauss(n/12)
        + gauss(n/14)
        + 1.56 * gauss(n/18)
        - 10.21 * gauss(n/21) + 2.5
    )

def natural(n):
    if n == 1:
        return 6
    return (
        n ** 2
        + 5 * n
        + 1 / 3 * gauss(crab(n-1)+1/6)
        + abs(sgn(n-18))
        -1
    )

def heart(n): # Good
    return (
    -0.108619328203 * (n - 13) ** 8 - 0.89254349046 * (n - 13) ** 7 + 4.028909531826 * (n - 13) ** 6
+ 46.685540925124 * (n - 13) ** 5 + 12.72752364919 * (n - 13) ** 4 - 584.765580407247 * (n - 13) ** 3
- 689.76145021645 * (n - 13) ** 2 + 2147.85894660894 * (n - 13) + 3054.2
)

def dia(n):
    return (
        (-1) ** (n+1)
        + 30 * cos((n+1) * pi)
        - 10 * sin((n+1)*pi/2)
        + 20*cos((n+1)*pi/2)
        -57
    )

def section(n):
    return (
        -0.596915584416 * n ** 5 + 17.144751082251 * n ** 4
-169.363365800866 * n ** 3 + 683.832521645022 * n ** 2 - 1134.62088744588 * n + 1050.1
    )

def sharp(n): # Good
    if n == 1:
        return 1307
    return (
        abs(
            -18 * (n-10) ** 2
            + 11 * (n-10) + 250
        ) + 7 * dagger(n-1)
    )

def beta(n):
    if n == 1:
        return 446
    return (
        beta(n-1)
        - gauss(page(n-1) + 1/2)
        - 20
    )


functions = [
	(circle,"〇"), # Good
	(circle_c,"©"), # Good
	(empty,"∅"),
	(yen,"￥"),
	(delta_big,"Δ"),
	(page,"¶"), # Good
	(star,"★"), # Good
	(dagger,"†"), # Good
	(dell,"∂"), # Good
	(delta_small,"δ"), # Good
	(alpha,"α"),
	(ae,"Æ"), # Good
	(eps,"ε"), # Good
	(crab,"♣"), # Good
	(asterisc,"＊"),
	(question,"？"), # Good
	(psi,"Ψ"),
	(pond,"£"), # Good
	(ce,"CE"),
	(spade,"♠"), # Good
	(natural,"♮"), # Good
	(heart,"♡"), # Good
	(dia,"♢"),
	(section,"§"),
	(sharp,"♯"), # Good
	(beta,"β"),
]


mvs = """
371 1848
2031 -124
5411031 1445367.094
0.07 96.411
2.5 0.97
-150 1.01
238 414
194.012 924.333
61 419
234 8901.759
54 5951.5
143 804.4
3002 168.561
6474 -1196
-3050 10769.875
1726 616
498 -11.71
445 14912459693.857
5.857 7789.5
-6060 28056982221.857
"""

open('o.txt','w').write(mvs.replace(' ','\t\t\t\t'))

mvs = sum(list(map(lambda s: list(map(float,s.split(' '))),mvs.split('\n')[1:-1])),[])

mvs = (
	[529,13157127,4092,16414] +
	[690,912001,66,245]
)+ mvs

mvs = [162115600556,162013079] + mvs

print(mvs)

f_data = list(map(lambda fs: (fs[0].__name__,fs[1], [fs[0](n) for n in range(1,41)]),functions))


ts = []
res = ""
for qc,q in enumerate(mvs):
	s = str(q)
	adds = ""
	for na,nas,vs in f_data:
		for i,v in enumerate(vs):
			if abs(q-v) < 0.001:
				print(na,i+1,v)
				adds += "%s%d" % (nas,i+1)
	ts = "%s\t%s\t\t\t" % (s,adds)
	res += ts
	if qc % 2 == 1:
		res += '\n'
	if qc == 7:
		res += ">" * 20 + "ここまで冒頭の数式" + "<" * 20 + "\n"

print(res)
open('o2.txt','w', encoding='UTF-8').write(res)


```