OFFSET
0,1
COMMENTS
Also x^2 = A091661.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..9999
EXAMPLE
7^5 - 7 == 0 mod 10,
57^5 - 57 == 0 mod 10^2,
57^5 - 57 == 0 mod 10^3,
7057^5 - 7057 == 0 mod 10^4.
PROG
(Ruby)
def P(n)
s1, s2 = 2, 8
n.times{|i|
m = 10 ** (i + 1)
(0..9).each{|j|
k1, k2 = j * m + s1, (9 - j) * m + s2
if (k1 ** 5 - k1) % (m * 10) == 0 && (k2 ** 5 - k2) % (m * 10) == 0
s1, s2 = k1, k2
break
end
}
}
s1
end
def Q(s, n)
n.times{|i|
m = 10 ** (i + 1)
(0..9).each{|j|
k = j * m + s
if (k ** 2 - k) % (m * 10) == 0
s = k
break
end
}
}
s
end
def A290374(n)
m = P(n) + Q(5, n)
m.to_s.reverse.split('').map(&:to_i)[0..n]
end
p A290374(100)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Seiichi Manyama, Jul 28 2017
STATUS
proposed