|
|
A362272
|
|
a(1) = 1, then multiply, subtract, and add 2, 3, 4; 5, 6, 7; ... in that order.
|
|
3
|
|
|
1, 2, -1, 3, 15, 9, 16, 128, 119, 129, 1419, 1407, 1420, 19880, 19865, 19881, 337977, 337959, 337978, 6759560, 6759539, 6759561, 155469903, 155469879, 155469904, 4042217504, 4042217477, 4042217505, 117224307645, 117224307615, 117224307646, 3751177844672, 3751177844639
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(1)=1; for n > 1,
a(n) = a(n-1) * n if n mod 3 = 2,
a(n-1) - n if n mod 3 = 0,
a(n-1) + n if n mod 3 = 1.
|
|
EXAMPLE
|
a(2) = 1 * 2 = 2;
a(3) = 2 - 3 = -1;
a(4) = -1 + 4 = 3.
|
|
PROG
|
(Python)
from itertools import count, islice
def A362272_gen(): # generator of terms
yield (a:=1)
for n in count(2, 3):
yield (a:=a*n)
yield (a:=a-n-1)
yield (a:=a+n+2)
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|