OFFSET
1,3
COMMENTS
Positive terms have no trailing zero in decimal representation (A067251), and are uniquely determined by their final digit d (A010879) and the number of digits, say k, in their decimal expansion (A055642); d*k cannot be a multiple of 10.
If m belongs to the sequence, then A217657(m) also belongs to the sequence.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..1826
EXAMPLE
- 6 * 1 = 6 mod 10,
- 6 * 2 = 2 mod 10,
- 6 * 3 = 8 mod 10,
- 6 * 4 = 4 mod 10,
- so 4826 belongs to the sequence.
PROG
(PARI) is(n) = { my (r=n); for (k=1, oo, if (r==0, return (1), (n*k)%10!=r%10, return (0), r\=10)) }
(PARI) print (setbinop((d, k) -> sum(i=1, k, 10^(i-1) * ((d*i)%10)), [1..9], [0..6]))
(Python)
def ok(m):
d = str(m)
return all(d[-i] == 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):
aklst = []
for d1 in range(1, 10):
d = [(d1*i)%10 for i in range(k, 0, -1)]
if d[0] != 0: aklst.append(int("".join(map(str, d))))
alst.extend(sorted(aklst))
return alst
print(auptod(6)) # Michael S. Branicky, May 29 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, May 28 2021
STATUS
approved