cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A212193 In ternary representation of n: a(n) = if n is pandigital then 3 else least digit not used.

Original entry on oeis.org

1, 0, 0, 2, 0, 0, 1, 0, 0, 2, 2, 3, 2, 0, 0, 3, 0, 0, 1, 3, 1, 3, 0, 0, 1, 0, 0, 2, 2, 3, 2, 2, 3, 3, 3, 3, 2, 2, 3, 2, 0, 0, 3, 0, 0, 3, 3, 3, 3, 0, 0, 3, 0, 0, 1, 3, 1, 3, 3, 3, 1, 3, 1, 3, 3, 3, 3, 0, 0, 3, 0, 0, 1, 3, 1, 3, 0, 0, 1, 0, 0, 2, 2, 3, 2, 2
Offset: 0

Views

Author

Reinhard Zumkeller, May 04 2012

Keywords

Comments

a(A032924(n)) = 0; a(A081605(n)) <> 0;
a(A031944(n)) = 3; a(A154314(n)) <> 3.

Examples

			.   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.
		

Crossrefs

Cf. A007089, A067898 (decimal).

Programs

  • 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