cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A209466 Final digit of n^n - n.

This page as a plain text file.
%I A209466 #22 Mar 28 2024 09:01:41
%S A209466 1,0,2,4,2,0,0,6,8,0,0,0,4,0,2,0,0,0,6,0,0,0,2,4,2,0,0,6,8,0,0,0,4,0,
%T A209466 2,0,0,0,6,0,0,0,2,4,2,0,0,6,8,0,0,0,4,0,2,0,0,0,6,0,0,0,2,4,2,0,0,6,
%U A209466 8,0,0,0,4,0,2,0,0,0,6,0,0,0,2,4,2,0,0
%N A209466 Final digit of n^n - n.
%C A209466 Note: cyclic with a period of 20 for n > 0.
%D A209466 R. Euler & J. Sadek, "A number that gives the units of n^n", Journal of Recreational Mathematics 29:3 (1998), pp. 203-204.
%H A209466 <a href="/index/Rec#order_20">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1).
%F A209466 a(n) = (n^n-n) mod 10
%p A209466 [seq((n^n-n) mod 10, n=1..40)];
%t A209466 Join[{1}, Table[Mod[PowerMod[n, n, 10] - n, 10], {n, 100}]] (* _T. D. Noe_, Mar 13 2012 *)
%t A209466 PadRight[{1},120,{0,0,2,4,2,0,0,6,8,0,0,0,4,0,2,0,0,0,6,0}] (* _Harvey P. Dale_, May 21 2020 *)
%o A209466 (Perl) print (($_**$_-$_)%10) for (1..40);
%o A209466 (PARI) a(n)=lift(Mod(n,10)^n-n) \\ _Charles R Greathouse IV_, Mar 13 2012
%Y A209466 Cf. A056849.
%K A209466 nonn,easy,base
%O A209466 0,3
%A A209466 _Radu Borza_, Mar 09 2012