OFFSET
0,4
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Ternary
Eric Weisstein's World of Mathematics, Pandigital Number
Wikipedia, Ternary numeral system
Wikipedia, Pandigital number
EXAMPLE
. 0 -> '0': a(0) = 1
. 1 -> '1': a(1) = 0
. 2 -> '2': a(2) = 0
. 3 -> '10': a(3) = 2
. 4 -> '11': a(4) = 0
. 5 -> '12': a(5) = 0
. 6 -> '20': a(6) = 1
. 7 -> '21': a(7) = 0
. 8 -> '22': a(8) = 0
. 9 -> '100': a(9) = 2
. 10 -> '101': a(10) = 2
. 11 -> '102': a(11) = 3 <-- 11 is the smallest 3-pandigital number
. 12 -> '110': a(12) = 2
. 13 -> '111': a(13) = 0
. 14 -> '112': a(14) = 0
. 15 -> '120': a(15) = 3.
PROG
(Haskell)
import Data.List (delete)
a212193 n = f n [0..3] where
f x ys | x <= 2 = head $ delete x ys
| otherwise = f x' $ delete d ys where (x', d) = divMod x 3
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, May 04 2012
STATUS
approved