-
Notifications
You must be signed in to change notification settings - Fork 11
/
binet_oeis_crawl.py
46 lines (38 loc) · 959 Bytes
/
binet_oeis_crawl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
# Author Dario Clavijo 2021
import sys
import oeispy as op
def binet(a, b, n):
return ((a**n) - (b**n)) / (a - b)
"""
a b resulting pol
0 2 2**n
1 3 3**n
3 5 A005059 a(n) = (5^n - 3^n)/2.
5 7 A081200
"""
l = 20
for i in range(0, l):
for j in range(i, l):
tmp = []
if i != j:
for k in range(1, l):
try:
tmp.append(str(round(binet(i, j, k))))
except:
pass
q = ",".join(tmp)
try:
res = op.resultEois(q)
m = "a: %d, b: %d, Name: A%06d, Desc: %s\n" % (
i,
j,
op.getNumber(res[0]),
op.getName(res[0]),
)
except:
m = ""
sys.stderr.write(m)
sys.stdout.write(m)
sys.stdout.flush()
sys.stderr.flush()