login
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

%I #10 Aug 09 2022 14:18:23

%S 1,2,4,1,4,9,54,47,376,385,3850,3839,46068,46081,645134,645119,

%T 10321904,10321921,185794578,185794559,3715891180,3715891201,

%U 81749606422,81749606399,1961990553576,1961990553601,51011754393626,51011754393599,1428329123020772

%N 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.

%H Michael S. Branicky, <a href="/A085111/b085111.txt">Table of n, a(n) for n = 1..808</a>

%o (Python)

%o from itertools import count, islice

%o def agen(): # generator of terms

%o an = 1

%o for n in count(1):

%o yield an

%o if n&1: an += (n if n&3 == 1 else -n)

%o else: an *= n

%o print(list(islice(agen(), 30))) # _Michael S. Branicky_, Aug 09 2022

%K nonn

%O 1,2

%A _Amarnath Murthy_, Jul 04 2003

%E More terms from _Ray G. Opao_, Apr 15 2004

%E a(26) and beyond from _Michael S. Branicky_, Aug 09 2022