A053794 a(n) = (n^2 + n) modulo 8.
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
Links
- Antti Karttunen, Table of n, a(n) for n = 0..8191
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1,-1,1).
Programs
-
Mathematica
PadRight[{}, 105, {0, 2, 6, 4, 4, 6, 2, 0}] (* Michael De Vlieger, Jun 22 2022 *)
-
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
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)
Extensions
More terms from James Sellers, Apr 08 2000
Extended to n=103 by Antti Karttunen, Aug 10 2017
Comments