OFFSET
1,2
COMMENTS
Sequence is periodic with period length 1560. a(n) is even iff n is a multiple of 5. - Klaus Brockhaus, Sep 06 2006
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..1560
FORMULA
a(1) = 1, a(2) = 9, a(3) = 7, a(4) = 9; for n >= 5, a(n) = (a(n-1) + a(n-2) + a(n-3) + a(n-4)) (mod 10)
a(n+1560) = a(n). - Michael S. Branicky, Oct 25 2024
MATHEMATICA
s={1, 9, 7, 9}; Do[AppendTo[s, Mod[Total[s[[-4;; ]]], 10]], {n, 101}]; s (* James C. McMahon, Oct 24 2024 *)
PROG
(Python)
from itertools import islice
def agen(): # generator of terms
a = [1, 9, 7, 9]
yield from a
while True:
an = sum(a)%10
yield an
a = a[1:] + [an]
print(list(islice(agen(), 105))) # Michael S. Branicky, Oct 25 2024
CROSSREFS
KEYWORD
easy,nonn,base,changed
AUTHOR
Stephen J Sugden (ssugden(AT)gmail.com), Sep 02 2006
EXTENSIONS
Extended by Klaus Brockhaus, Sep 06 2006
STATUS
approved