login
A143959
Final digit of n^(n+1)-(n+1)^n for n>2
0
7, 9, 9, 7, 9, 7, 1, 9, 3, 1, 5, 9, 9, 5, 1, 1, 1, 9, 9, 9, 7, 9, 9, 7, 9, 7, 1, 9, 3, 1, 5, 9, 9, 5, 1, 1, 1, 9, 9, 9, 7, 9, 9, 7, 9, 7, 1, 9, 3, 1, 5, 9, 9, 5, 1, 1, 1, 9, 9, 9, 7, 9, 9, 7, 9, 7, 1, 9, 3, 1, 5, 9, 9, 5, 1, 1, 1, 9, 9, 9, 7, 9, 9, 7, 9, 7, 1, 9, 3, 1, 5, 9, 9, 5, 1, 1, 1, 9, 9, 9
OFFSET
3,1
COMMENTS
Cyclic with a period of 20
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
MATHEMATICA
Last[IntegerDigits[#^(#+1)-(#+1)^#]]&/@ Range[3, 150] (* Harvey P. Dale, Mar 12 2011 *)
PROG
(Python) # -*- coding: iso-8859-1 -*- from math import * n=3 while n<100: ....r=(n**(n+1)-(n+1)**n)%10 ....print r, ....n=n+1
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
STATUS
approved