|
|
A371295
|
|
Value k at the n-th step of A371282, where multiplied values are positive and subtracted values are negative.
|
|
2
|
|
|
2, 3, -1, 4, -17, 5, -11, 6, -16, 7, -49, 9, -54, 8, -62, 10, -89, 12, -120, 13, -143, 14, -168, 15, -194, 18, -271, 19, -305, 20, -341, 21, -378, 22, -440, 23, -483, 24, -527, 25, -599, 26, -649, 27, -701, 28, -755, 29, -811, 30, -869, 31, -929, 32, -991, 33
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
|
|
PROG
|
(Python)
from itertools import islice
def agen(): # generator of terms
mina, an, aset, mink, kset = 1, 1, {1}, 1, set()
while True:
k1, ak1, k2 = 0, mina, mink
if mina < an:
for ak1 in range(mina, an-mink+1):
if ak1 not in aset and an - ak1 not in kset:
k1 = an - ak1
break
while k2 in kset or an*k2 in aset:
k2 += 1
an, k = (an-k1, k1) if k1 > 0 else (an*k2, k2)
yield -k if k1 > 0 else k
aset.add(an)
kset.add(k)
while mina in aset: mina += 1
while mink in kset: mink += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|