login
A085111
a(1) = 1; then add 1, multiply by 2, subtract 3, multiply by 4, add 5, multiply by 6, subtract 7, multiply by 8 and so on.
1
1, 2, 4, 1, 4, 9, 54, 47, 376, 385, 3850, 3839, 46068, 46081, 645134, 645119, 10321904, 10321921, 185794578, 185794559, 3715891180, 3715891201, 81749606422, 81749606399, 1961990553576, 1961990553601, 51011754393626, 51011754393599, 1428329123020772
OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..808
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
an = 1
for n in count(1):
yield an
if n&1: an += (n if n&3 == 1 else -n)
else: an *= n
print(list(islice(agen(), 30))) # Michael S. Branicky, Aug 09 2022
CROSSREFS
Sequence in context: A256696 A244261 A361873 * A181332 A204021 A236471
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Jul 04 2003
EXTENSIONS
More terms from Ray G. Opao, Apr 15 2004
a(26) and beyond from Michael S. Branicky, Aug 09 2022
STATUS
approved