[go: up one dir, main page]

login
A053794
a(n) = (n^2 + n) modulo 8.
1
0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0, 0, 2, 6, 4, 4, 6, 2, 0
OFFSET
0,2
COMMENTS
Periodic with period 8.
FORMULA
From Wesley Ivan Hurt, Jun 22 2022: (Start)
a(n) = 2*A105198(n).
a(n) = a(n-1)-a(n-2)+a(n-3)-a(n-4)+a(n-5)-a(n-6)+a(n-7). (End)
MATHEMATICA
PadRight[{}, 105, {0, 2, 6, 4, 4, 6, 2, 0}] (* Michael De Vlieger, Jun 22 2022 *)
PROG
(PARI) A053794(n)=[0, 2, 6, 4, 4, 6, 2, 0][n%8+1] \\ M. F. Hasler, Aug 27 2012
(Scheme) (define (A053794 n) (modulo (+ (* n n) n) 8)) ;; Antti Karttunen, Aug 10 2017
CROSSREFS
Sequence in context: A187817 A276678 A276680 * A249913 A003077 A323482
KEYWORD
nonn,easy
AUTHOR
Stuart M. Ellerstein (ellerstein(AT)aol.com), Mar 27 2000
EXTENSIONS
More terms from James A. Sellers, Apr 08 2000
Extended to n=103 by Antti Karttunen, Aug 10 2017
STATUS
approved