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.
%I A218560 #8 Nov 03 2012 13:05:13 %S A218560 0,1,2,9,10,12,14,16,17,18,20,22,23,24,25,248,250,251,254,257,258,259, %T A218560 262,263,264,265,267,269,272,275,276,277,281,285,287,288,289,291,293, %U A218560 295,296,298,299,300,301,303,305,306,307,309,311,313,314,315,317,319,320,321,322,326,329,330,331,335 %N A218560 Numbers with d distinct ternary digits (d=1,2,3) such that for each k=1,...,d, some digit occurs exactly k times. %C A218560 For each of the terms, the number of ternary (= base 3) digits is a triangular number A000217. %C A218560 The base 2 analog would have only the 5 terms 0,1,4,5,6. See A218556 for the base 10 analog. %C A218560 The sequence A167819 is a subsequence containing exactly all terms >= 9. %C A218560 The sequence is finite, with 255=3+12+240 (= 1 + sum of the 3rd row of A218566) terms. %H A218560 M. F. Hasler, <a href="/A218560/b218560.txt">Table of n, a(n) for n = 1..255</a> (full sequence). %e A218560 The terms a(1)=0 through a(3)=2 have exactly 1 digit occurring exactly once. %e A218560 The terms a(4)=9=100[3] through a(15)=25=221[3], have one ternary digit occurring once and a second, different digit occurring exactly twice. %e A218560 The terms a(16)=248=100012[3] through a(255)=714=222110[3] contain each ternary digit at least once. There are no other terms in this sequence. %o A218560 (PARI) {my(T(n)=n*(n+1)\2); print1(0); for(i=1,3, s=vector(i+1,j,j-1); for(n=3^(T(i)-1),3^T(i)-1,i !=#Set(digits(n,3)) & next; c=vector(4); for(j=1,#d=digits(n,3),c[d[j]+1]++); vecsort(c,,8)==s & print1(","n)))} %o A218560 (PARI) is_A218560(n,b=3)={ my(c=vector(b+1)); for(i=1,#n=digits(n,b),c[n[i]+1]++); #(c=vecsort(c,,8))==1+c[#c] && 2*#n==c[#c]*#c } %Y A218560 Cf. A218559, A182040, A218556. %K A218560 nonn,easy,base,fini,full %O A218560 1,3 %A A218560 _M. F. Hasler_, Nov 02 2012