OFFSET
1,3
COMMENTS
This sequence is infinite as it contains d * A002275(k) for any d in {1, 5, 6} and k > 0.
Also contains terms with patterns 4(64)^k, 9(19)^k, 2(4862)^k, 3(9713)^k, 7(9317)^k, 8(4268)^k for k >= 0, where ^ denotes repeated concatenation; all terms have first and last digits the same. - Michael S. Branicky, May 29 2021
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..1253
Rémy Sigrist, PARI program for A344823
EXAMPLE
- 4^1 = 4 mod 10,
- 4^2 = 6 mod 10,
- 4^3 = 4 mod 10,
- so 464 belongs to the sequence.
PROG
(PARI) is(n) = { my (d=digits(n), m=Mod(n, 10)); for (k=1, #d, if (d[k] != m^k, return (0))); return (1) }
(PARI) See Links section.
(Python)
def ok(m):
d = str(m)
return all(d[i-1] == str((m**i)%10) for i in range(1, len(d)+1))
print(list(filter(ok, range(10**6)))) # Michael S. Branicky, May 29 2021
(Python)
def auptod(maxdigits):
alst = [0]
for k in range(1, maxdigits+1):
for d1 in range(1, 10):
d = [(d1**i)%10 for i in range(1, k+1)]
if d1 == d[-1]: alst.append(int("".join(map(str, d))))
return alst
print(auptod(9)) # Michael S. Branicky, May 29 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 29 2021
STATUS
approved