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 A108551 #37 Mar 20 2025 10:36:17 %S A108551 100,136,1425,389305,8946176,225331713,6210001000,186492227801, %T A108551 6073061476032,213404945384449,8054585122464440,325144322753909625, %U A108551 13983676842985394176,638488718313248327681,30852387539151417415368,1573159469597805848539033,84423475200000000000008000 %N A108551 Self-descriptive numbers in various bases represented in base 10. %C A108551 A self-descriptive number in base b has b digits, indexed by 0 ... b-1 and for all n, the n-th digit equals the number of n's in the number. In base 10 there is exactly one such number, 6210001000. %C A108551 From _Iain Fox_, Sep 16 2020: (Start) %C A108551 (b-4)*b^(b-1) + 2*b^(b-2) + b^(b-3) + b^3 is in this sequence for b=4 and b>6. %C A108551 For b>6, there exists exactly one self-descriptive number of base b. This number is of the form stated in the comment above. %C A108551 Proof: A number in this sequence is of the form x_0*b^(b-1) + x_1*b^(b-2) + ... + x_{b-2}*b + x_{b-1} where x_i is an integer on the interval [0, b-1] and represents the number of times i appears in the sequence d = x_0, x_1, ..., x_{b-1}. Trivially, x_0 > 0. Let p be the number of nonzero terms in the sequence d. It is easy to see that p = Sum_{i=1..b-1} x_i. Since x_0 > 0, the number of nonzero terms in the sequence e = x_1, x_2, ..., x_{b-1} is p-1. Since the sum of the terms of e is one more than the number of nonzero terms in e, one term of e is 2 and the rest are either 0 or 1. This means that the only terms that can be in d are 0, 1, 2, and x_0, and thus there can be a maximum of four nonzero terms in d. Since there is a maximum of four nonzero terms in d, it is trivial that, for b>6, x_0>2. Thus, for b>6, there are exactly four nonzero terms in d. It is simple to determine that the four nonzero terms are x_0 = b-4, x_1 = 2, x_2 = 1, and x_{x_0} = x_{b-4} = 1. %C A108551 (End) %D A108551 Clifford Pickover, Keys to Infinity, Chapter 28, "Chaos in Ontario." New York: Wiley, pp. 217-219, 1995. %H A108551 Iain Fox, <a href="/A108551/b108551.txt">Table of n, a(n) for n = 1..350</a> %H A108551 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_22">On Some Special Numbers</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 22, 527-565. %H A108551 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Self-DescriptiveNumber.html">Self-Descriptive Number</a>. %H A108551 Wikipedia, <a href="https://en.wikipedia.org/wiki/Self-descriptive_number">Self-descriptive number</a> %F A108551 From _Iain Fox_, Sep 16 2020: (Start) %F A108551 For n>3, %F A108551 a(n) = (n-1)*(n+3)^(n+2) + 2*(n+3)^(n+1) + (n+3)^n + (n+3)^3 = (n+2)*(n*(n+3)-1)*(n+3)^n + (n+3)^3. %F A108551 a(n) = A274943(n+3). %F A108551 (End) %e A108551 1210_4 = 100, 2020_4 = 136, 21200_5 = 1425, 3211000_7 = 389305, %e A108551 42101000_8 = 8946176, 521001000_9 = 225331713, 6210001000_10, %e A108551 72100001000_11 = 186492227801, 821000001000_12 = 6073061476032, %e A108551 9210000001000_13 = 213404945384449, (10)2100000001000_14 = %e A108551 8054585122464440, (11)21000000001000_15 = 325144322753909625, %e A108551 (12)21000000001000_16 = 13983676842985394176, etc. %t A108551 Do[id = IntegerDigits[n, base]; If[id == (Count[id, # ] & /@ Range[0, base - 1]), Print[n]], {base, 2, 10}, {n, base^(base - 1), (base^base) - 1, base}] %t A108551 (* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) fQ[lst_] := (lst == (Count[lst, # ] & /@ Range[0, Length[lst] - 1])); f[n_] := Block[{pts = PadLeft[ #, n] & /@ Partitions[n], k = 1, l = PartitionsP[n], lst = {}}, While[k < l, AppendTo[ lst, FromDigits[ Flatten[ Select[ Permutations[ pts[[k]]], fQ[ # ] &]], n]]; k++ ]; Drop[ Union[ lst], 1]]; Table[ f[n], {n, 2, 15}] (* _Robert G. Wilson v_, Jun 07 2005 *) %o A108551 (PARI) a(n)=if(n<4, [100, 136, 1425][n], (n+2)*(n*(n+3)-1)*(n+3)^n+(n+3)^3) \\ _Iain Fox_, Sep 16 2020 %Y A108551 Cf. A046043. See A274943 for another version. %K A108551 base,nonn %O A108551 1,1 %A A108551 _Alonso del Arte_, Jun 07 2005 %E A108551 a(14)-a(17) from _Iain Fox_, Sep 16 2020