A302096 a(n) is the smallest pandigital number divisible by n, or 0 if no such pandigital number exists.
1023456789, 1023456798, 1023456789, 1023457896, 1023467895, 1023456798, 1023456798, 1023457896, 1023456789, 1234567890, 1024375869, 1023457896, 1023456798, 1023456798, 1023467895, 1023457968, 1023457698, 1023456798, 1023458769, 1234567980, 1023456798, 1024375968
Offset: 1
Examples
a(11) = 1024375869 = 11 * 93125079 because it is the smallest pandigital number that is divisible by 11; a(100) = 0 because there is no pandigital number that is divisible by 100.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
- Michael S. Branicky, Python program for OEIS A302096
- Rodolfo Kurchan, Mis Acertijos, 2004 Pandigital y primo (in Spanish).
- Carlos Rivera, Puzzle 259
Programs
-
Mathematica
s = Select[FromDigits /@ Permutations[Range[0, 9]], # > 10^9 &]; Table[ SelectFirst[ s, Mod[#, n] == 0 &, 0], {n, 22}] (* Giovanni Resta, May 15 2018 *)
-
Python
# see link for another program from itertools import permutations def a(n): return next((t for p in permutations("0123456789") if p[0] != "0" and (t:=int("".join(p)))%n == 0), 0) print([a(n) for n in range(1, 23)]) # Michael S. Branicky, Mar 05 2025
Comments