login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A071358 Least k>0 such that the last digit of (n+k)^n is the same as the last digit of n^n. 0
10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10, 10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10, 10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10, 10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
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).
FORMULA
a(n) is periodic with period (10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10) of length 20
MATHEMATICA
LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10}, 80] (* Ray Chandler, Aug 26 2015 *)
PROG
(PARI) a(n)=if(n<0, 0, s=1; while(abs((n+s)^n%10-n^n%10)>0, s++); s)
(Python)
def a(n):
k, target = 2, pow(n, n, 10)
while pow(n+k, n, 10) != target: k += 2
return k
print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Oct 06 2021
CROSSREFS
Sequence in context: A304879 A105155 A072930 * A167873 A369702 A033986
KEYWORD
easy,nonn,base
AUTHOR
Benoit Cloitre, Aug 13 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 30 10:25 EDT 2024. Contains 372131 sequences. (Running on oeis4.)