A222810 Number of n-digit numbers N with distinct digits such that the reversal of N divides N.
9, 9, 3, 5, 3, 2, 0, 0, 0
Offset: 1
Examples
Solutions with 1 through 6 digits: [1, 2, 3, 4, 5, 6, 7, 8, 9], [10, 20, 30, 40, 50, 60, 70, 80, 90], [510, 540, 810], [5610, 5940, 8712, 8910, 9801], [65340, 87120, 87912], [659340, 879120],
Programs
-
Python
import collections col = [] count = 0 for n in range(0, 9): a = 10**n stop = 10**(n+1) while a < stop: b = str(a) c = list(b) d = c[::-1] e = int("".join(c)) f = int("".join(d)) counter = collections.Counter(c) if e % f == 0 and counter.most_common(1)[0][1] == 1: count += 1 col.append(a) a += 1 print(n+1, " digits: ", count, " elements: ", col) count = 0 col = [] # David Consiglio, Jr., Dec 04 2014
Extensions
a(8)-a(9) from David Consiglio, Jr., Dec 04 2014
Comments