Esthetic numbers: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎{{header|REXX}}: changed a comment.)
(julia example)
Line 504: Line 504:
123456789898987898 123456789898989876 123456789898989878 123456789898989898
123456789898987898 123456789898989876 123456789898989878 123456789898989898
</pre>
</pre>

=={{header|Julia}}==
Illustrates both brute force and iterative methods of generating numbers in the sequence.
<lang julia>using Formatting
import Base.iterate, Base.IteratorSize, Base.IteratorEltype

"""
struct Esthetic
Used for iteration of esthetic numbers
"""
struct Esthetic{T}
lowerlimit::T where T <: Integer
base::T
upperlimit::T
Esthetic{T}(n, bas, m=typemax(T)) where T = new{T}(nextesthetic(n, bas), bas, m)
end

Base.IteratorSize(n::Esthetic) = Base.IsInfinite()
Base.IteratorEltype(n::Esthetic) = Integer
function Base.iterate(es::Esthetic, state=typeof(es.lowerlimit)[])
state = isempty(state) ? digits(es.lowerlimit, base=es.base) : increment!(state, es.base, 1)
n = toInt(state, es.base)
return n <= es.upperlimit ? (n, state) : nothing
end

isesthetic(n, b) = (d = digits(n, base=b); all(i -> abs(d[i] - d[i + 1]) == 1, 1:length(d)-1))
toInt(dig, bas) = foldr((i, j) -> i + bas * j, dig)
nextesthetic(n, b) = for i in n:typemax(typeof(n)) if isesthetic(i, b) return i end; end

""" Fill the digits below pos in vector with the least esthetic number fitting there """
function filldecreasing!(vec, pos)
if pos > 1
n = vec[pos]
for i in pos-1:-1:1
n = (n == 0) ? 1 : n - 1
vec[i] = n
end
end
return vec
end

""" Get the next esthetic number's digits from the previous number's digits """
function increment!(vec, bas, startpos = 1)
len = length(vec)
if len == 1
if vec[1] < bas - 1
vec[1] += 1
else
vec[1] = 0
push!(vec, 1)
end
else
pos = findfirst(i -> vec[i] < vec[i + 1], startpos:len-1)
if pos == nothing
if vec[end] >= bas - 1
filldecreasing!(vcat(vec, 1), len + 1)
else
vec[end] += 1
filldecreasing!(vec, len)
end
else
for i in pos:len
if i == len
if vec[i] < bas - 1
vec[i] += 1
filldecreasing!(vec, i)
else
push!(vec, 1)
filldecreasing!(vec, len + 1)
end
elseif vec[i] < vec[i + 1] && vec[i] < bas - 2
vec[i] += 2
filldecreasing!(vec, i)
break
end
end
end
end
return vec
end

for b in 2:16
println("For base $b, the esthetic numbers indexed from $(4b) to $(6b) are:")
printed = 0
for (i, n) in enumerate(Iterators.take(Esthetic{Int}(1, b), 6b))
if i >= 4b
printed += 1
print(string(n, base=b), printed % 21 == 20 ? "\n" : " ")
end
end
println("\n")
end

for (bottom, top, cols, T) in [[1000, 9999, 16, Int], [100_000_000, 130_000_000, 8, Int],
[101_010_000_000, 130_000_000_000, 6, Int], [101_010_101_010_000_000, 130_000_000_000_000_000, 4, Int],
[101_010_101_010_101_000_000, 130_000_000_000_000_000_000, 4, Int128]]
esth, n, count = Esthetic{T}(bottom, 10, top), zero(T), 0
println("\nBase 10 esthetic numbers between $(format(bottom, commas=true)) and $(format(top, commas=true)):")
for n in esth
count += 1
if count == 64
println(" ...")
elseif count < 64
print(format(n, commas=true), count % cols == 0 ? "\n" : " ")
end
end
println("\nTotal esthetic numbers in interval: $count")
end
</lang>{{out}}
<pre>
For base 2, the esthetic numbers indexed from 8 to 12 are:
10101010 101010101 1010101010 10101010101 101010101010

For base 3, the esthetic numbers indexed from 12 to 18 are:
1210 1212 2101 2121 10101 10121 12101

For base 4, the esthetic numbers indexed from 16 to 24 are:
323 1010 1012 1210 1212 1232 2101 2121 2123

For base 5, the esthetic numbers indexed from 20 to 30 are:
323 343 432 434 1010 1012 1210 1212 1232 1234 2101

For base 6, the esthetic numbers indexed from 24 to 36 are:
343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234

For base 7, the esthetic numbers indexed from 28 to 42 are:
345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232

For base 8, the esthetic numbers indexed from 32 to 48 are:
432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210 1212

For base 9, the esthetic numbers indexed from 36 to 54 are:
434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878 1010 1012 1210

For base 10, the esthetic numbers indexed from 40 to 60 are:
454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 987 989 1010
1012

For base 11, the esthetic numbers indexed from 44 to 66 are:
456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9
a98 a9a 1010

For base 12, the esthetic numbers indexed from 48 to 72 are:
543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab
a98 a9a aba ba9 bab

For base 13, the esthetic numbers indexed from 52 to 78 are:
545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98
a9a aba abc ba9 bab bcb cba

For base 14, the esthetic numbers indexed from 56 to 84 are:
565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a
aba abc ba9 bab bcb bcd cba cbc cdc

For base 15, the esthetic numbers indexed from 60 to 90 are:
567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba
abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd

For base 16, the esthetic numbers indexed from 64 to 96 are:
654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc
ba9 bab bcb bcd cba cbc cdc cde dcb dcd ded def edc


Base 10 esthetic numbers between 1,000 and 9,999:
1,010 1,012 1,210 1,212 1,232 1,234 2,101 2,121 2,123 2,321 2,323 2,343 2,345 3,210 3,212 3,232
3,234 3,432 3,434 3,454 3,456 4,321 4,323 4,343 4,345 4,543 4,545 4,565 4,567 5,432 5,434 5,454
5,456 5,654 5,656 5,676 5,678 6,543 6,545 6,565 6,567 6,765 6,767 6,787 6,789 7,654 7,656 7,676
7,678 7,876 7,878 7,898 8,765 8,767 8,787 8,789 8,987 8,989 9,876 9,878 9,898
Total esthetic numbers in interval: 61

Base 10 esthetic numbers between 100,000,000 and 130,000,000:
101,010,101 101,010,121 101,010,123 101,012,101 101,012,121 101,012,123 101,012,321 101,012,323
101,012,343 101,012,345 101,210,101 101,210,121 101,210,123 101,212,101 101,212,121 101,212,123
101,212,321 101,212,323 101,212,343 101,212,345 101,232,101 101,232,121 101,232,123 101,232,321
101,232,323 101,232,343 101,232,345 101,234,321 101,234,323 101,234,343 101,234,345 101,234,543
101,234,545 101,234,565 101,234,567 121,010,101 121,010,121 121,010,123 121,012,101 121,012,121
121,012,123 121,012,321 121,012,323 121,012,343 121,012,345 121,210,101 121,210,121 121,210,123
121,212,101 121,212,121 121,212,123 121,212,321 121,212,323 121,212,343 121,212,345 121,232,101
121,232,121 121,232,123 121,232,321 121,232,323 121,232,343 121,232,345 121,234,321 ...

Total esthetic numbers in interval: 126

Base 10 esthetic numbers between 101,010,000,000 and 130,000,000,000:
101,010,101,010 101,010,101,012 101,010,101,210 101,010,101,212 101,010,101,232 101,010,101,234
101,010,121,010 101,010,121,012 101,010,121,210 101,010,121,212 101,010,121,232 101,010,121,234
101,010,123,210 101,010,123,212 101,010,123,232 101,010,123,234 101,010,123,432 101,010,123,434
101,010,123,454 101,010,123,456 101,012,101,010 101,012,101,012 101,012,101,210 101,012,101,212
101,012,101,232 101,012,101,234 101,012,121,010 101,012,121,012 101,012,121,210 101,012,121,212
101,012,121,232 101,012,121,234 101,012,123,210 101,012,123,212 101,012,123,232 101,012,123,234
101,012,123,432 101,012,123,434 101,012,123,454 101,012,123,456 101,012,321,010 101,012,321,012
101,012,321,210 101,012,321,212 101,012,321,232 101,012,321,234 101,012,323,210 101,012,323,212
101,012,323,232 101,012,323,234 101,012,323,432 101,012,323,434 101,012,323,454 101,012,323,456
101,012,343,210 101,012,343,212 101,012,343,232 101,012,343,234 101,012,343,432 101,012,343,434
101,012,343,454 101,012,343,456 101,012,345,432 ...

Total esthetic numbers in interval: 911

Base 10 esthetic numbers between 101,010,101,010,000,000 and 130,000,000,000,000,000:
101,010,101,010,101,010 101,010,101,010,101,012 101,010,101,010,101,210 101,010,101,010,101,212
101,010,101,010,101,232 101,010,101,010,101,234 101,010,101,010,121,010 101,010,101,010,121,012
101,010,101,010,121,210 101,010,101,010,121,212 101,010,101,010,121,232 101,010,101,010,121,234
101,010,101,010,123,210 101,010,101,010,123,212 101,010,101,010,123,232 101,010,101,010,123,234
101,010,101,010,123,432 101,010,101,010,123,434 101,010,101,010,123,454 101,010,101,010,123,456
101,010,101,012,101,010 101,010,101,012,101,012 101,010,101,012,101,210 101,010,101,012,101,212
101,010,101,012,101,232 101,010,101,012,101,234 101,010,101,012,121,010 101,010,101,012,121,012
101,010,101,012,121,210 101,010,101,012,121,212 101,010,101,012,121,232 101,010,101,012,121,234
101,010,101,012,123,210 101,010,101,012,123,212 101,010,101,012,123,232 101,010,101,012,123,234
101,010,101,012,123,432 101,010,101,012,123,434 101,010,101,012,123,454 101,010,101,012,123,456
101,010,101,012,321,010 101,010,101,012,321,012 101,010,101,012,321,210 101,010,101,012,321,212
101,010,101,012,321,232 101,010,101,012,321,234 101,010,101,012,323,210 101,010,101,012,323,212
101,010,101,012,323,232 101,010,101,012,323,234 101,010,101,012,323,432 101,010,101,012,323,434
101,010,101,012,323,454 101,010,101,012,323,456 101,010,101,012,343,210 101,010,101,012,343,212
101,010,101,012,343,232 101,010,101,012,343,234 101,010,101,012,343,432 101,010,101,012,343,434
101,010,101,012,343,454 101,010,101,012,343,456 101,010,101,012,345,432 ...

Total esthetic numbers in interval: 44744

Base 10 esthetic numbers between 101,010,101,010,101,000,000 and 130,000,000,000,000,000,000:
101,010,101,010,101,010,101 101,010,101,010,101,010,121 101,010,101,010,101,010,123 101,010,101,010,101,012,101
101,010,101,010,101,012,121 101,010,101,010,101,012,123 101,010,101,010,101,012,321 101,010,101,010,101,012,323
101,010,101,010,101,012,343 101,010,101,010,101,012,345 101,010,101,010,101,210,101 101,010,101,010,101,210,121
101,010,101,010,101,210,123 101,010,101,010,101,212,101 101,010,101,010,101,212,121 101,010,101,010,101,212,123
101,010,101,010,101,212,321 101,010,101,010,101,212,323 101,010,101,010,101,212,343 101,010,101,010,101,212,345
101,010,101,010,101,232,101 101,010,101,010,101,232,121 101,010,101,010,101,232,123 101,010,101,010,101,232,321
101,010,101,010,101,232,323 101,010,101,010,101,232,343 101,010,101,010,101,232,345 101,010,101,010,101,234,321
101,010,101,010,101,234,323 101,010,101,010,101,234,343 101,010,101,010,101,234,345 101,010,101,010,101,234,543
101,010,101,010,101,234,545 101,010,101,010,101,234,565 101,010,101,010,101,234,567 101,010,101,010,121,010,101
101,010,101,010,121,010,121 101,010,101,010,121,010,123 101,010,101,010,121,012,101 101,010,101,010,121,012,121
101,010,101,010,121,012,123 101,010,101,010,121,012,321 101,010,101,010,121,012,323 101,010,101,010,121,012,343
101,010,101,010,121,012,345 101,010,101,010,121,210,101 101,010,101,010,121,210,121 101,010,101,010,121,210,123
101,010,101,010,121,212,101 101,010,101,010,121,212,121 101,010,101,010,121,212,123 101,010,101,010,121,212,321
101,010,101,010,121,212,323 101,010,101,010,121,212,343 101,010,101,010,121,212,345 101,010,101,010,121,232,101
101,010,101,010,121,232,121 101,010,101,010,121,232,123 101,010,101,010,121,232,321 101,010,101,010,121,232,323
101,010,101,010,121,232,343 101,010,101,010,121,232,345 101,010,101,010,121,234,321 ...

Total esthetic numbers in interval: 312019
</pre>


=={{header|Pascal}}==
=={{header|Pascal}}==
Simple brute force, but fast counting for complete digit ranges.
Simple brute force, but fast counting for complete digit ranges.

Revision as of 04:19, 20 March 2020

Esthetic numbers is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

An esthetic number is a positive integer where every adjacent digit differs from its neighbour by 1.


E.G.
  • 12 is an esthetic number. One and two differ by 1.
  • 5654 is an esthetic number. Each digit is exactly 1 away from its neighbour.
  • 890 is not an esthetic number. Nine and zero differ by 9.


These examples are nominally in base 10 but the concept extends easily to numbers in other bases. Traditionally, single digit numbers are included in esthetic numbers; zero may or may not be. For our purposes, for this task, do not include zero (0) as an esthetic number. Do not include numbers with leading zeros.

Esthetic numbers are also sometimes referred to as stepping numbers.


Task
  • Write a routine (function, procedure, whatever) to find esthetic numbers in a given base.
  • Use that routine to find esthetic numbers in bases 2 through 16 and display, here on this page, the esthectic numbers from index (base × 4) through index (base × 6), inclusive. (E.G. for base 2: 8th through 12th, for base 6: 24th through 36th, etc.)
  • Find and display, here on this page, the base 10 esthetic numbers with a magnitude between 1000 and 9999.
  • Stretch: Find and display, here on this page, the base 10 esthetic numbers with a magnitude between 1.0e8 and 1.3e8.


See also


C

Translation of: Go

<lang c>#include <stdio.h>

  1. include <string.h>
  2. include <locale.h>

typedef int bool; typedef unsigned long long ull;

  1. define TRUE 1
  2. define FALSE 0

char as_digit(int d) {

   return (d >= 0 && d <= 9) ? d + '0' : d - 10 + 'a';  

}

void revstr(char *str) {

   int i, len = strlen(str);
   char t; 
   for (i = 0; i < len/2; ++i) { 
       t = str[i]; 
       str[i] = str[len - i - 1]; 
       str[len - i - 1] = t; 
   } 

}

char* to_base(char s[], ull n, int b) {

   int i = 0; 
   while (n) { 
       s[i++] = as_digit(n % b); 
       n /= b; 
   } 
   s[i] = '\0'; 
   revstr(s);
   return s;  

}

ull uabs(ull a, ull b) {

   return a > b ? a - b : b - a;

}

bool is_esthetic(ull n, int b) {

   int i, j;
   if (!n) return FALSE;
   i = n % b;
   n /= b;
   while (n) {
       j = n % b;
       if (uabs(i, j) != 1) return FALSE;
       n /= b;
       i = j;
   }
   return TRUE;

}

ull esths[45000]; int le = 0;

void dfs(ull n, ull m, ull i) {

   ull d, i1, i2;
   if (i >= n && i <= m) esths[le++] = i;
   if (i == 0 || i > m) return; 
   d = i % 10;
   i1 = i * 10 + d - 1;
   i2 = i1 + 2;
   if (d == 0) {
       dfs(n, m, i2);
   } else if (d == 9) {
       dfs(n, m, i1);
   } else {
       dfs(n, m, i1);
       dfs(n, m, i2);
   }

}

void list_esths(ull n, ull n2, ull m, ull m2, int perLine, bool all) {

   int i;
   le = 0;
   for (i = 0; i < 10; ++i) {
       dfs(n2, m2, i);
   }
   printf("Base 10: %'d esthetic numbers between %'llu and %'llu:\n", le, n, m);
   if (all) {
       for (i = 0; i < le; ++i) {
           printf("%llu ", esths[i]);
           if (!(i+1)%perLine) printf("\n");
       }
   } else {
       for (i = 0; i < perLine; ++i) printf("%llu ", esths[i]);
       printf("\n............\n");
       for (i = le - perLine; i < le; ++i) printf("%llu ", esths[i]);
   }
   printf("\n\n");

}

int main() {

   ull n;
   int b, c;
   char ch[15] = {0};
   for (b = 2; b <= 16; ++b) {
       printf("Base %d: %dth to %dth esthetic numbers:\n", b, 4*b, 6*b);
       for (n = 1, c = 0; c < 6 * b; ++n) {
           if (is_esthetic(n, b)) {
               if (++c >= 4 * b) printf("%s ", to_base(ch, n, b));
           }
       }
       printf("\n\n");
   }
   char *oldLocale = setlocale(LC_NUMERIC, NULL);
   setlocale(LC_NUMERIC, ""); 
   // the following all use the obvious range limitations for the numbers in question
   list_esths(1000, 1010, 9999, 9898, 16, TRUE);
   list_esths(1e8, 101010101, 13*1e7, 123456789, 9, TRUE);
   list_esths(1e11, 101010101010, 13*1e10, 123456789898, 7, FALSE);
   list_esths(1e14, 101010101010101, 13*1e13, 123456789898989, 5, FALSE);
   list_esths(1e17, 101010101010101010, 13*1e16, 123456789898989898, 4, FALSE);
   setlocale(LC_NUMERIC, oldLocale);
   return 0;

}</lang>

Output:
Same as Go entry.

Factor

The bfs word is an adaptation of the algorithm from the Geeks for Geeks reference. It has been changed to work with any base. In summary, this algorithm constructs esthetic numbers directly using a breadth first search. For example, we know the only two esthetic numbers that can be constructed from 23 are 232 and 234, or in other words, the last digit of 23 ± 1 appended to 23. This forms a tree for each digit in a given base where each node is an esthetic number and can have at most two children. This method is very fast and has been used to find the count of esthetic numbers in base 10 between zero and one quadrillion.

Works with: Factor version 0.99 2020-01-23

<lang factor>USING: combinators deques dlists formatting grouping io kernel locals make math math.order math.parser math.ranges math.text.english prettyprint sequences sorting strings ;

bfs ( from to num base -- )
   DL{ } clone :> q
   base 1 - :> ld
   num q push-front
   [ q deque-empty? ]
   [
       q pop-back :> step-num
       step-num from to between? [ step-num , ] when
       step-num zero? step-num to > or
       [
           step-num base mod :> last-digit
           step-num base * last-digit 1 - + :> a
           step-num base * last-digit 1 + + :> b
           last-digit
           {
               { 0 [ b q push-front ] }
               { ld [ a q push-front ] }
               [ drop a q push-front b q push-front ]
           } case
       ] unless
   ] until ;
esthetics ( from to base -- seq )
   [ base <iota> [| num | from to num base bfs ] each ]
   { } make natural-sort ;
.seq ( seq width -- )
   group [ [ dup string? [ write ] [ pprint ] if bl ] each nl ]
   each nl ;
show ( base -- )
   base [ 4 * ] [ 6 * ] bi :> ( from to )
   from to [ dup ordinal-suffix ] bi@ base
   "%d%s through %d%s esthetic numbers in base %d\n" printf
   from to 1 + 0 5000   ! enough for base 16
   base esthetics subseq [ base >base ] map 17 .seq ;

2 16 [a,b] [ show ] each

"Base 10 numbers between 1,000 and 9,999:" print 1,000 9,999 10 esthetics 16 .seq

"Base 10 numbers between 100,000,000 and 130,000,000:" print 100,000,000 130,000,000 10 esthetics 9 .seq

"Count of base 10 esthetic numbers between zero and one quadrillion:" print 0 1e15 10 esthetics length .</lang>

Output:
8th through 12th esthetic numbers in base 2
10101010 101010101 1010101010 10101010101 101010101010 

12th through 18th esthetic numbers in base 3
1210 1212 2101 2121 10101 10121 12101 

16th through 24th esthetic numbers in base 4
323 1010 1012 1210 1212 1232 2101 2121 2123 

20th through 30th esthetic numbers in base 5
323 343 432 434 1010 1012 1210 1212 1232 1234 2101 

24th through 36th esthetic numbers in base 6
343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234 

28th through 42nd esthetic numbers in base 7
345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232 

32nd through 48th esthetic numbers in base 8
432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210 1212 

36th through 54th esthetic numbers in base 9
434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878 1010 
1012 1210 

40th through 60th esthetic numbers in base 10
454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 
987 989 1010 1012 

44th through 66th esthetic numbers in base 11
456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 
987 989 9a9 a98 a9a 1010 

48th through 72nd esthetic numbers in base 12
543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 
989 9a9 9ab a98 a9a aba ba9 bab 

52nd through 78th esthetic numbers in base 13
545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 
9a9 9ab a98 a9a aba abc ba9 bab bcb cba 

56th through 84th esthetic numbers in base 14
565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 
9ab a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc 

60th through 90th esthetic numbers in base 15
567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab 
a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd 

64th through 96th esthetic numbers in base 16
654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 
a9a aba abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd ded def edc 

Base 10 numbers between 1,000 and 9,999:
1010 1012 1210 1212 1232 1234 2101 2121 2123 2321 2323 2343 2345 3210 3212 3232 
3234 3432 3434 3454 3456 4321 4323 4343 4345 4543 4545 4565 4567 5432 5434 5454 
5456 5654 5656 5676 5678 6543 6545 6565 6567 6765 6767 6787 6789 7654 7656 7676 
7678 7876 7878 7898 8765 8767 8787 8789 8987 8989 9876 9878 9898 

Base 10 numbers between 100,000,000 and 130,000,000:
101010101 101010121 101010123 101012101 101012121 101012123 101012321 101012323 101012343 
101012345 101210101 101210121 101210123 101212101 101212121 101212123 101212321 101212323 
101212343 101212345 101232101 101232121 101232123 101232321 101232323 101232343 101232345 
101234321 101234323 101234343 101234345 101234543 101234545 101234565 101234567 121010101 
121010121 121010123 121012101 121012121 121012123 121012321 121012323 121012343 121012345 
121210101 121210121 121210123 121212101 121212121 121212123 121212321 121212323 121212343 
121212345 121232101 121232121 121232123 121232321 121232323 121232343 121232345 121234321 
121234323 121234343 121234345 121234543 121234545 121234565 121234567 123210101 123210121 
123210123 123212101 123212121 123212123 123212321 123212323 123212343 123212345 123232101 
123232121 123232123 123232321 123232323 123232343 123232345 123234321 123234323 123234343 
123234345 123234543 123234545 123234565 123234567 123432101 123432121 123432123 123432321 
123432323 123432343 123432345 123434321 123434323 123434343 123434345 123434543 123434545 
123434565 123434567 123454321 123454323 123454343 123454345 123454543 123454545 123454565 
123454567 123456543 123456545 123456565 123456567 123456765 123456767 123456787 123456789 

Count of base 10 esthetic numbers between zero and one quadrillion:
161914

Go

A simple brute force approach suffices for the first and second parts of the task.

For the last two parts (stretched up to 1.0e17/1.3e17), a 'depth first search' approach is used with the obvious range limitations imposed for extra speed. <lang go>package main

import (

   "fmt"
   "strconv"

)

func uabs(a, b uint64) uint64 {

   if a > b {
       return a - b
   }
   return b - a

}

func isEsthetic(n, b uint64) bool {

   if n == 0 {
       return false
   }
   i := n % b
   n /= b
   for n > 0 {
       j := n % b
       if uabs(i, j) != 1 {
           return false
       }
       n /= b
       i = j
   }
   return true

}

var esths []uint64

func dfs(n, m, i uint64) {

   if i >= n && i <= m {
       esths = append(esths, i)
   }
   if i == 0 || i > m {
       return
   }
   d := i % 10
   i1 := i*10 + d - 1
   i2 := i1 + 2
   if d == 0 {
       dfs(n, m, i2)
   } else if d == 9 {
       dfs(n, m, i1)
   } else {
       dfs(n, m, i1)
       dfs(n, m, i2)
   }

}

func listEsths(n, n2, m, m2 uint64, perLine int, all bool) {

   esths = esths[:0]
   for i := uint64(0); i < 10; i++ {
       dfs(n2, m2, i)
   }
   le := len(esths)
   fmt.Printf("Base 10: %s esthetic numbers between %s and %s:\n",
       commatize(uint64(le)), commatize(n), commatize(m))
   if all {
       for c, esth := range esths {
           fmt.Printf("%d ", esth)
           if (c+1)%perLine == 0 {
               fmt.Println()
           }
       }
   } else {
       for i := 0; i < perLine; i++ {
           fmt.Printf("%d ", esths[i])
       }
       fmt.Println("\n............\n")
       for i := le - perLine; i < le; i++ {
           fmt.Printf("%d ", esths[i])
       }
   }
   fmt.Println("\n")

}

func commatize(n uint64) string {

   s := fmt.Sprintf("%d", n)
   le := len(s)
   for i := le - 3; i >= 1; i -= 3 {
       s = s[0:i] + "," + s[i:]
   }
   return s

}

func main() {

   for b := uint64(2); b <= 16; b++ {
       fmt.Printf("Base %d: %dth to %dth esthetic numbers:\n", b, 4*b, 6*b)
       for n, c := uint64(1), uint64(0); c < 6*b; n++ {
           if isEsthetic(n, b) {
               c++
               if c >= 4*b {
                   fmt.Printf("%s ", strconv.FormatUint(n, int(b)))
               }
           }
       }
       fmt.Println("\n")
   }
   // the following all use the obvious range limitations for the numbers in question
   listEsths(1000, 1010, 9999, 9898, 16, true)
   listEsths(1e8, 101_010_101, 13*1e7, 123_456_789, 9, true)
   listEsths(1e11, 101_010_101_010, 13*1e10, 123_456_789_898, 7, false)
   listEsths(1e14, 101_010_101_010_101, 13*1e13, 123_456_789_898_989, 5, false)
   listEsths(1e17, 101_010_101_010_101_010, 13*1e16, 123_456_789_898_989_898, 4, false)

}</lang>

Output:
Base 2: 8th to 12th esthetic numbers:
10101010 101010101 1010101010 10101010101 101010101010 

Base 3: 12th to 18th esthetic numbers:
1210 1212 2101 2121 10101 10121 12101 

Base 4: 16th to 24th esthetic numbers:
323 1010 1012 1210 1212 1232 2101 2121 2123 

Base 5: 20th to 30th esthetic numbers:
323 343 432 434 1010 1012 1210 1212 1232 1234 2101 

Base 6: 24th to 36th esthetic numbers:
343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234 

Base 7: 28th to 42th esthetic numbers:
345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232 

Base 8: 32th to 48th esthetic numbers:
432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210 1212 

Base 9: 36th to 54th esthetic numbers:
434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878 1010 1012 1210 

Base 10: 40th to 60th esthetic numbers:
454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 987 989 1010 1012 

Base 11: 44th to 66th esthetic numbers:
456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 a98 a9a 1010 

Base 12: 48th to 72th esthetic numbers:
543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba ba9 bab 

Base 13: 52th to 78th esthetic numbers:
545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb cba 

Base 14: 56th to 84th esthetic numbers:
565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc 

Base 15: 60th to 90th esthetic numbers:
567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd 

Base 16: 64th to 96th esthetic numbers:
654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd ded def edc 

Base 10: 61 esthetic numbers between 1,000 and 9,999:
1010 1012 1210 1212 1232 1234 2101 2121 2123 2321 2323 2343 2345 3210 3212 3232 
3234 3432 3434 3454 3456 4321 4323 4343 4345 4543 4545 4565 4567 5432 5434 5454 
5456 5654 5656 5676 5678 6543 6545 6565 6567 6765 6767 6787 6789 7654 7656 7676 
7678 7876 7878 7898 8765 8767 8787 8789 8987 8989 9876 9878 9898 

Base 10: 126 esthetic numbers between 100,000,000 and 130,000,000:
101010101 101010121 101010123 101012101 101012121 101012123 101012321 101012323 101012343 
101012345 101210101 101210121 101210123 101212101 101212121 101212123 101212321 101212323 
101212343 101212345 101232101 101232121 101232123 101232321 101232323 101232343 101232345 
101234321 101234323 101234343 101234345 101234543 101234545 101234565 101234567 121010101 
121010121 121010123 121012101 121012121 121012123 121012321 121012323 121012343 121012345 
121210101 121210121 121210123 121212101 121212121 121212123 121212321 121212323 121212343 
121212345 121232101 121232121 121232123 121232321 121232323 121232343 121232345 121234321 
121234323 121234343 121234345 121234543 121234545 121234565 121234567 123210101 123210121 
123210123 123212101 123212121 123212123 123212321 123212323 123212343 123212345 123232101 
123232121 123232123 123232321 123232323 123232343 123232345 123234321 123234323 123234343 
123234345 123234543 123234545 123234565 123234567 123432101 123432121 123432123 123432321 
123432323 123432343 123432345 123434321 123434323 123434343 123434345 123434543 123434545 
123434565 123434567 123454321 123454323 123454343 123454345 123454543 123454545 123454565 
123454567 123456543 123456545 123456565 123456567 123456765 123456767 123456787 123456789 


Base 10: 911 esthetic numbers between 100,000,000,000 and 130,000,000,000:
101010101010 101010101012 101010101210 101010101212 101010101232 101010101234 101010121010 
............

123456787678 123456787876 123456787878 123456787898 123456789876 123456789878 123456789898 

Base 10: 6,225 esthetic numbers between 100,000,000,000,000 and 130,000,000,000,000:
101010101010101 101010101010121 101010101010123 101010101012101 101010101012121 
............

123456789898767 123456789898787 123456789898789 123456789898987 123456789898989 

Base 10: 44,744 esthetic numbers between 100,000,000,000,000,000 and 130,000,000,000,000,000:
101010101010101010 101010101010101012 101010101010101210 101010101010101212 
............

123456789898987898 123456789898989876 123456789898989878 123456789898989898 

Julia

Illustrates both brute force and iterative methods of generating numbers in the sequence. <lang julia>using Formatting import Base.iterate, Base.IteratorSize, Base.IteratorEltype

"""

   struct Esthetic
   

Used for iteration of esthetic numbers """ struct Esthetic{T}

   lowerlimit::T where T <: Integer
   base::T
   upperlimit::T
   Esthetic{T}(n, bas, m=typemax(T)) where T = new{T}(nextesthetic(n, bas), bas, m)

end

Base.IteratorSize(n::Esthetic) = Base.IsInfinite() Base.IteratorEltype(n::Esthetic) = Integer function Base.iterate(es::Esthetic, state=typeof(es.lowerlimit)[])

   state = isempty(state) ? digits(es.lowerlimit, base=es.base) : increment!(state, es.base, 1)
   n = toInt(state, es.base)
   return n <= es.upperlimit ? (n, state) : nothing

end

isesthetic(n, b) = (d = digits(n, base=b); all(i -> abs(d[i] - d[i + 1]) == 1, 1:length(d)-1)) toInt(dig, bas) = foldr((i, j) -> i + bas * j, dig) nextesthetic(n, b) = for i in n:typemax(typeof(n)) if isesthetic(i, b) return i end; end

""" Fill the digits below pos in vector with the least esthetic number fitting there """ function filldecreasing!(vec, pos)

   if pos > 1
       n = vec[pos]
       for i in pos-1:-1:1
           n = (n == 0) ? 1 : n - 1
           vec[i] = n
       end
   end
   return vec

end

""" Get the next esthetic number's digits from the previous number's digits """ function increment!(vec, bas, startpos = 1)

   len = length(vec)
   if len == 1
       if vec[1] < bas - 1
           vec[1] += 1
       else
           vec[1] = 0
           push!(vec, 1)
       end
   else
       pos = findfirst(i -> vec[i] < vec[i + 1], startpos:len-1)
       if pos == nothing
           if vec[end] >= bas - 1
               filldecreasing!(vcat(vec, 1), len + 1)
           else
               vec[end] += 1
               filldecreasing!(vec, len)
           end
       else
           for i in pos:len
               if i == len
                   if vec[i] < bas - 1
                       vec[i] += 1
                       filldecreasing!(vec, i)
                   else
                       push!(vec, 1)
                       filldecreasing!(vec, len + 1)
                   end
               elseif vec[i] < vec[i + 1] && vec[i] < bas - 2
                   vec[i] += 2
                   filldecreasing!(vec, i)
                   break
               end
           end
       end
   end
   return vec

end

for b in 2:16

   println("For base $b, the esthetic numbers indexed from $(4b) to $(6b) are:")
   printed = 0
   for (i, n) in enumerate(Iterators.take(Esthetic{Int}(1, b), 6b))
       if i >= 4b
           printed += 1
           print(string(n, base=b), printed % 21 == 20 ? "\n" : " ")
       end
   end
   println("\n")

end

for (bottom, top, cols, T) in [[1000, 9999, 16, Int], [100_000_000, 130_000_000, 8, Int],

       [101_010_000_000, 130_000_000_000, 6, Int], [101_010_101_010_000_000, 130_000_000_000_000_000, 4, Int], 
       [101_010_101_010_101_000_000, 130_000_000_000_000_000_000, 4, Int128]]
   esth, n, count = Esthetic{T}(bottom, 10, top), zero(T), 0
   println("\nBase 10 esthetic numbers between $(format(bottom, commas=true)) and $(format(top, commas=true)):")
   for n in esth
       count += 1
       if count == 64
           println(" ...")
       elseif count < 64
           print(format(n, commas=true), count % cols == 0 ? "\n" : " ")
       end
   end
   println("\nTotal esthetic numbers in interval: $count")

end

</lang>

Output:
For base 2, the esthetic numbers indexed from 8 to 12 are:
10101010 101010101 1010101010 10101010101 101010101010

For base 3, the esthetic numbers indexed from 12 to 18 are:
1210 1212 2101 2121 10101 10121 12101

For base 4, the esthetic numbers indexed from 16 to 24 are:
323 1010 1012 1210 1212 1232 2101 2121 2123

For base 5, the esthetic numbers indexed from 20 to 30 are:
323 343 432 434 1010 1012 1210 1212 1232 1234 2101

For base 6, the esthetic numbers indexed from 24 to 36 are:
343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234

For base 7, the esthetic numbers indexed from 28 to 42 are:
345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232

For base 8, the esthetic numbers indexed from 32 to 48 are:
432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210 1212

For base 9, the esthetic numbers indexed from 36 to 54 are:
434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878 1010 1012 1210

For base 10, the esthetic numbers indexed from 40 to 60 are:
454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 987 989 1010
1012

For base 11, the esthetic numbers indexed from 44 to 66 are:
456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9
a98 a9a 1010

For base 12, the esthetic numbers indexed from 48 to 72 are:
543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab
a98 a9a aba ba9 bab

For base 13, the esthetic numbers indexed from 52 to 78 are:
545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98
a9a aba abc ba9 bab bcb cba

For base 14, the esthetic numbers indexed from 56 to 84 are:
565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a
aba abc ba9 bab bcb bcd cba cbc cdc

For base 15, the esthetic numbers indexed from 60 to 90 are:
567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba
abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd

For base 16, the esthetic numbers indexed from 64 to 96 are:
654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc
ba9 bab bcb bcd cba cbc cdc cde dcb dcd ded def edc


Base 10 esthetic numbers between 1,000 and 9,999:
1,010 1,012 1,210 1,212 1,232 1,234 2,101 2,121 2,123 2,321 2,323 2,343 2,345 3,210 3,212 3,232
3,234 3,432 3,434 3,454 3,456 4,321 4,323 4,343 4,345 4,543 4,545 4,565 4,567 5,432 5,434 5,454
5,456 5,654 5,656 5,676 5,678 6,543 6,545 6,565 6,567 6,765 6,767 6,787 6,789 7,654 7,656 7,676
7,678 7,876 7,878 7,898 8,765 8,767 8,787 8,789 8,987 8,989 9,876 9,878 9,898
Total esthetic numbers in interval: 61

Base 10 esthetic numbers between 100,000,000 and 130,000,000:
101,010,101 101,010,121 101,010,123 101,012,101 101,012,121 101,012,123 101,012,321 101,012,323
101,012,343 101,012,345 101,210,101 101,210,121 101,210,123 101,212,101 101,212,121 101,212,123
101,212,321 101,212,323 101,212,343 101,212,345 101,232,101 101,232,121 101,232,123 101,232,321
101,232,323 101,232,343 101,232,345 101,234,321 101,234,323 101,234,343 101,234,345 101,234,543
101,234,545 101,234,565 101,234,567 121,010,101 121,010,121 121,010,123 121,012,101 121,012,121
121,012,123 121,012,321 121,012,323 121,012,343 121,012,345 121,210,101 121,210,121 121,210,123
121,212,101 121,212,121 121,212,123 121,212,321 121,212,323 121,212,343 121,212,345 121,232,101
121,232,121 121,232,123 121,232,321 121,232,323 121,232,343 121,232,345 121,234,321  ...

Total esthetic numbers in interval: 126

Base 10 esthetic numbers between 101,010,000,000 and 130,000,000,000:
101,010,101,010 101,010,101,012 101,010,101,210 101,010,101,212 101,010,101,232 101,010,101,234
101,010,121,010 101,010,121,012 101,010,121,210 101,010,121,212 101,010,121,232 101,010,121,234
101,010,123,210 101,010,123,212 101,010,123,232 101,010,123,234 101,010,123,432 101,010,123,434
101,010,123,454 101,010,123,456 101,012,101,010 101,012,101,012 101,012,101,210 101,012,101,212
101,012,101,232 101,012,101,234 101,012,121,010 101,012,121,012 101,012,121,210 101,012,121,212
101,012,121,232 101,012,121,234 101,012,123,210 101,012,123,212 101,012,123,232 101,012,123,234
101,012,123,432 101,012,123,434 101,012,123,454 101,012,123,456 101,012,321,010 101,012,321,012
101,012,321,210 101,012,321,212 101,012,321,232 101,012,321,234 101,012,323,210 101,012,323,212
101,012,323,232 101,012,323,234 101,012,323,432 101,012,323,434 101,012,323,454 101,012,323,456
101,012,343,210 101,012,343,212 101,012,343,232 101,012,343,234 101,012,343,432 101,012,343,434
101,012,343,454 101,012,343,456 101,012,345,432  ...

Total esthetic numbers in interval: 911

Base 10 esthetic numbers between 101,010,101,010,000,000 and 130,000,000,000,000,000:
101,010,101,010,101,010 101,010,101,010,101,012 101,010,101,010,101,210 101,010,101,010,101,212
101,010,101,010,101,232 101,010,101,010,101,234 101,010,101,010,121,010 101,010,101,010,121,012
101,010,101,010,121,210 101,010,101,010,121,212 101,010,101,010,121,232 101,010,101,010,121,234
101,010,101,010,123,210 101,010,101,010,123,212 101,010,101,010,123,232 101,010,101,010,123,234
101,010,101,010,123,432 101,010,101,010,123,434 101,010,101,010,123,454 101,010,101,010,123,456
101,010,101,012,101,010 101,010,101,012,101,012 101,010,101,012,101,210 101,010,101,012,101,212
101,010,101,012,101,232 101,010,101,012,101,234 101,010,101,012,121,010 101,010,101,012,121,012
101,010,101,012,121,210 101,010,101,012,121,212 101,010,101,012,121,232 101,010,101,012,121,234
101,010,101,012,123,210 101,010,101,012,123,212 101,010,101,012,123,232 101,010,101,012,123,234
101,010,101,012,123,432 101,010,101,012,123,434 101,010,101,012,123,454 101,010,101,012,123,456
101,010,101,012,321,010 101,010,101,012,321,012 101,010,101,012,321,210 101,010,101,012,321,212
101,010,101,012,321,232 101,010,101,012,321,234 101,010,101,012,323,210 101,010,101,012,323,212
101,010,101,012,323,232 101,010,101,012,323,234 101,010,101,012,323,432 101,010,101,012,323,434
101,010,101,012,323,454 101,010,101,012,323,456 101,010,101,012,343,210 101,010,101,012,343,212
101,010,101,012,343,232 101,010,101,012,343,234 101,010,101,012,343,432 101,010,101,012,343,434
101,010,101,012,343,454 101,010,101,012,343,456 101,010,101,012,345,432  ...

Total esthetic numbers in interval: 44744

Base 10 esthetic numbers between 101,010,101,010,101,000,000 and 130,000,000,000,000,000,000:
101,010,101,010,101,010,101 101,010,101,010,101,010,121 101,010,101,010,101,010,123 101,010,101,010,101,012,101
101,010,101,010,101,012,121 101,010,101,010,101,012,123 101,010,101,010,101,012,321 101,010,101,010,101,012,323
101,010,101,010,101,012,343 101,010,101,010,101,012,345 101,010,101,010,101,210,101 101,010,101,010,101,210,121
101,010,101,010,101,210,123 101,010,101,010,101,212,101 101,010,101,010,101,212,121 101,010,101,010,101,212,123
101,010,101,010,101,212,321 101,010,101,010,101,212,323 101,010,101,010,101,212,343 101,010,101,010,101,212,345
101,010,101,010,101,232,101 101,010,101,010,101,232,121 101,010,101,010,101,232,123 101,010,101,010,101,232,321
101,010,101,010,101,232,323 101,010,101,010,101,232,343 101,010,101,010,101,232,345 101,010,101,010,101,234,321
101,010,101,010,101,234,323 101,010,101,010,101,234,343 101,010,101,010,101,234,345 101,010,101,010,101,234,543
101,010,101,010,101,234,545 101,010,101,010,101,234,565 101,010,101,010,101,234,567 101,010,101,010,121,010,101
101,010,101,010,121,010,121 101,010,101,010,121,010,123 101,010,101,010,121,012,101 101,010,101,010,121,012,121
101,010,101,010,121,012,123 101,010,101,010,121,012,321 101,010,101,010,121,012,323 101,010,101,010,121,012,343
101,010,101,010,121,012,345 101,010,101,010,121,210,101 101,010,101,010,121,210,121 101,010,101,010,121,210,123
101,010,101,010,121,212,101 101,010,101,010,121,212,121 101,010,101,010,121,212,123 101,010,101,010,121,212,321
101,010,101,010,121,212,323 101,010,101,010,121,212,343 101,010,101,010,121,212,345 101,010,101,010,121,232,101
101,010,101,010,121,232,121 101,010,101,010,121,232,123 101,010,101,010,121,232,321 101,010,101,010,121,232,323
101,010,101,010,121,232,343 101,010,101,010,121,232,345 101,010,101,010,121,234,321  ...

Total esthetic numbers in interval: 312019


Pascal

Simple brute force, but fast counting for complete digit ranges. <lang pascal>program Esthetic; {$IFDEF FPC}

 {$R+,O+}{$MODE DELPHI}  {$OPTIMIZATION ON,ALL} {$codealign proc=16}

{$ELSE}

 {$APPTYPE CONSOLE}

{$ENDIF} uses

 sysutils,//IntToStr
 strutils;//Numb2USA aka commatize

const

 ConvBase :array[0..15] of char= '0123456789ABCDEF';
 maxBase = 16;

type

 tErg = string[63];
 tCnt = array[0..maxBase-1] of UInt64;

function ConvToBaseStr(n,base:NativeUint):tErg; var

 idx,
 dgt,
 rst : Uint64;

Begin

 IF n = 0 then
 Begin
   result := ConvBase[0];
   EXIT;
 end;
 idx := High(result);
 repeat
   rst := n div base;
   dgt := n-rst*base;
   result[idx] := ConvBase[dgt];
   dec(idx);
   n := rst;
 until n=0;
 rst := High(result)-idx;
 move(result[idx+1],result[1],rst);
 setlength(result,rst);

end;

function isEsthetic(n,base:Uint64):boolean; var

 lastdgt,
 dgt,
 rst : Uint64;

Begin

 result := true;
 IF n >= Base then
 Begin
   rst := n div base;
   Lastdgt := n-rst*base;
   n := rst;
   repeat
     rst := n div base;
     dgt := n-rst*base;
     //sqr instead of abs 
     IF sqr(lastDgt-dgt)<> 1 then
     Begin
       result := false;
       EXIT;
     end;
     lastDgt := dgt;
     n := rst;
   until n = 0;
 end;

end;

function CntEst(depth,base:NativeInt):UInt64; var

 B0,B1 : tCnt;
 i : NativeInt;

begin

 //First possibilities
 For i := 0 to Base-1 do
   B0[i] := 1;
 while depth > 1 do
 Begin
   //0 -> followed by solutions of 1
   B1[0] := B0[1];
   //Base-1 -> followed by solutions of Base-2
   B1[Base-1] := B0[Base-2];
   //follwed by solutions of i-1 and i+1
   For i := 1 to Base-2 do
     B1[i] := B0[i-1]+B0[i+1];
   B0 := B1;
   dec(depth);
 end;
 result := 0;
 //Start with 1
 For i := 1 to Base-1 do
   result += B0[i];

end; procedure TotalSum; var

 totSum,Sum : Uint64;
 i : NativeInt;

begin

 writeln('Number of n-digit terms in base 10 https://oeis.org/A090994 + sum');
 writeln('Digits':7,'Count':28,'sumCount':28);
 totSum := 0;
 For i := 1 to 24 do //max = 65 for UInt64
 Begin
   Sum := CntEst(i,10);
   inc(totSum,Sum);
   writeln(i:7,Numb2USA(IntToStr(Sum)):28,Numb2USA(IntToStr(totSum)):28);
 end;

end;

var

 i,base,cnt : NativeInt;

Begin

 cnt := 0;
 For base := 2 to 16 do
 Begin
   writeln(4*base,'th through ',6*base,'th esthetic numbers in base ',base);
   cnt := 0;
   i := 1;
   repeat
     if isEsthetic(i,base) then
     begin
       inc(cnt);
       IF cnt >= 4*base then
       Begin
         write(ConvToBaseStr(i,base),' ');
         If cnt >= 6*Base then
           BREAK;
       end;
     end;
     inc(i);
   until false;
   writeln;
 end;
 writeln;
 base := 10;cnt := 0;
 For i := 1000 to 9999 do
 Begin
   if isEsthetic(i,base) then
   Begin
     inc(cnt);
     write(i:5);
   end;
 end;
 writeln;writeln(cnt);writeln;
 cnt := 0;
 For i := 100*1000*1000 to 130*1000*1000 do
 Begin
   if  isEsthetic(i,base) then
   Begin
     inc(cnt);
     write(i:10);
   end;
 end;
 writeln;writeln(cnt);writeln;
 TotalSum;

end.</lang>

Output:
8th through 12th esthetic numbers in base 2
10101010 101010101 1010101010 10101010101 101010101010
12th through 18th esthetic numbers in base 3
1210 1212 2101 2121 10101 10121 12101
16th through 24th esthetic numbers in base 4
323 1010 1012 1210 1212 1232 2101 2121 2123
20th through 30th esthetic numbers in base 5
323 343 432 434 1010 1012 1210 1212 1232 1234 2101
24th through 36th esthetic numbers in base 6
343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234
28th through 42th esthetic numbers in base 7
345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232
32th through 48th esthetic numbers in base 8
432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210 1212
36th through 54th esthetic numbers in base 9
434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878 1010
1012 1210
40th through 60th esthetic numbers in base 10
454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 987
 989 1010 1012
44th through 66th esthetic numbers in base 11
456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987
989 9A9 A98 A9A 1010
48th through 72th esthetic numbers in base 12
543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989
9A9 9AB A98 A9A ABA BA9 BAB
52th through 78th esthetic numbers in base 13
545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9
9AB A98 A9A ABA ABC BA9 BAB BCB CBA
56th through 84th esthetic numbers in base 14
565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB
A98 A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC
60th through 90th esthetic numbers in base 15
567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB A98
A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC CDE DCB DCD
64th through 96th esthetic numbers in base 16
654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB A98 A9A
ABA ABC BA9 BAB BCB BCD CBA CBC CDC CDE DCB DCD DED DEF EDC

 1010 1012 1210 1212 1232 1234 2101 2121 2123 2321 2323 2343 2345 3210 3212
 3232 3234 3432 3434 3454 3456 4321 4323 4343 4345 4543 4545 4565 4567 5432
 5434 5454 5456 5654 5656 5676 5678 6543 6545 6565 6567 6765 6767 6787 6789
 7654 7656 7676 7678 7876 7878 7898 8765 8767 8787 8789 8987 8989 9876 9878
 9898


 101010101 101010121 101010123 101012101 101012121 101012123 101012321
 101012323 101012343 101012345 101210101 101210121 101210123 101212101
 101212121 101212123 101212321 101212323 101212343 101212345 101232101
 101232121 101232123 101232321 101232323 101232343 101232345 101234321
 101234323 101234343 101234345 101234543 101234545 101234565 101234567
 121010101 121010121 121010123 121012101 121012121 121012123 121012321
 121012323 121012343 121012345 121210101 121210121 121210123 121212101
 121212121 121212123 121212321 121212323 121212343 121212345 121232101
 121232121 121232123 121232321 121232323 121232343 121232345 121234321
 121234323 121234343 121234345 121234543 121234545 121234565 121234567
 123210101 123210121 123210123 123212101 123212121 123212123 123212321
 123212323 123212343 123212345 123232101 123232121 123232123 123232321
 123232323 123232343 123232345 123234321 123234323 123234343 123234345
 123234543 123234545 123234565 123234567 123432101 123432121 123432123
 123432321 123432323 123432343 123432345 123434321 123434323 123434343
 123434345 123434543 123434545 123434565 123434567 123454321 123454323
 123454343 123454345 123454543 123454545 123454565 123454567 123456543
 123456545 123456565 123456567 123456765 123456767 123456787 123456789

 126
Count of n-digit terms in base 10 https://oeis.org/A090994 + sum
 Digits                       Count                    sumCount
      1                           9                           9
      2                          17                          26
      3                          32                          58
      4                          61                         119
      5                         116                         235
      6                         222                         457
      7                         424                         881
      8                         813                       1,694
      9                       1,556                       3,250
     10                       2,986                       6,236
     11                       5,721                      11,957
     12                      10,982                      22,939
     13                      21,053                      43,992
     14                      40,416                      84,408
     15                      77,505                     161,913 < one less than factor
     16                     148,785                     310,698
     17                     285,380                     596,078
     18                     547,810                   1,143,888
     19                   1,050,876                   2,194,764
     20                   2,017,126                   4,211,890
     21                   3,869,845                   8,081,735
     22                   7,427,671                  15,509,406
     23                  14,250,855                  29,760,261
     24                  27,351,502                  57,111,763

Phix

Simple string based approach, very fast, manages stretch goal and much further in the blink of an eye. <lang Phix>constant aleph = "0123456789ABCDEF"

function efill(string s, integer ch, i)

   -- min-fill, like 10101 or 54321 or 32101
   s[i] = ch
   for j=i+1 to length(s) do
       ch = iff(ch>='1'?iff(ch='A'?'9':ch-1):'1')
       s[j] = ch
   end for
   return s

end function

function esthetic(string s, integer base = 10)

   -- generate the next esthetic number after s
   -- (nb unpredictable results if s is not esthetic, or "")
   for i=length(s) to 1 by -1 do
       integer ch = s[i], cp = iff(i>1?s[i-1]:'0')
       if ch<cp and cp<aleph[base] then
           return efill(s,aleph[find(ch,aleph)+2],i)
       elsif i=1 and ch<aleph[base] then
           return efill(s,iff(ch='9'?'A':ch+1),i)
       end if
   end for
   return efill("1"&s,'1',1)

end function

string s sequence res for base=2 to 16 do

   integer hi = base*6,
           lo = base*4
   {s,res} = {"",{}}
   for i=1 to hi do
       s = esthetic(s, base)
       if i>=lo then
           res = append(res,s)
       end if
   end for
   res = join(shorten(res,"numbers",4))
   printf(1,"Base %d esthetic numbers[%d..%d]: %s\n",{base,lo,hi,res})

end for

{s,res} = {efill("1000",'1',1),{}} while length(s)=4 do

   res = append(res,s)
   s = esthetic(s)

end while res = {join(shorten(res,"numbers",5))} printf(1,"\nBase 10 esthetic numbers between 1,000 and 9,999: %s\n\n",res)

function comma(string s)

   for i=length(s)-2 to 2 by -3 do
       s[i..i-1] = ","
   end for
   return s

end function

for k=7 to 19 by 3 do

   string f = "10"&repeat('0',k),
          t = "13"&repeat('0',k)
   {s,res} = {efill(f,'1',1),{}}
   while s<t do
       res = append(res,s)
       s = esthetic(s)
   end while
   res = join(shorten(res,"numbers",1))
   printf(1,"Base 10 esthetic numbers between %s and %s: %s\n",
            {comma(f),comma(t),res})

end for</lang>

Output:
Base 2 esthetic numbers[8..12]: 10101010 101010101 1010101010 10101010101 101010101010
Base 3 esthetic numbers[12..18]: 1210 1212 2101 2121 10101 10121 12101
Base 4 esthetic numbers[16..24]: 323 1010 1012 1210 1212 1232 2101 2121 2123
Base 5 esthetic numbers[20..30]: 323 343 432 434 ... 1212 1232 1234 2101  (11 numbers)
Base 6 esthetic numbers[24..36]: 343 345 432 434 ... 1210 1212 1232 1234  (13 numbers)
Base 7 esthetic numbers[28..42]: 345 432 434 454 ... 1012 1210 1212 1232  (15 numbers)
Base 8 esthetic numbers[32..48]: 432 434 454 456 ... 1010 1012 1210 1212  (17 numbers)
Base 9 esthetic numbers[36..54]: 434 454 456 543 ... 878 1010 1012 1210  (19 numbers)
Base 10 esthetic numbers[40..60]: 454 456 543 545 ... 987 989 1010 1012  (21 numbers)
Base 11 esthetic numbers[44..66]: 456 543 545 565 ... 9A9 A98 A9A 1010  (23 numbers)
Base 12 esthetic numbers[48..72]: 543 545 565 567 ... A9A ABA BA9 BAB  (25 numbers)
Base 13 esthetic numbers[52..78]: 545 565 567 654 ... BA9 BAB BCB CBA  (27 numbers)
Base 14 esthetic numbers[56..84]: 565 567 654 656 ... BCD CBA CBC CDC  (29 numbers)
Base 15 esthetic numbers[60..90]: 567 654 656 676 ... CDC CDE DCB DCD  (31 numbers)
Base 16 esthetic numbers[64..96]: 654 656 676 678 ... DCD DED DEF EDC  (33 numbers)

Base 10 esthetic numbers between 1,000 and 9,999: 1010 1012 1210 1212 1232 ... 8987 8989 9876 9878 9898  (61 numbers)

Base 10 esthetic numbers between 100,000,000 and 130,000,000: 101010101 ... 123456789  (126 numbers)
Base 10 esthetic numbers between 100,000,000,000 and 130,000,000,000: 101010101010 ... 123456789898  (911 numbers)
Base 10 esthetic numbers between 100,000,000,000,000 and 130,000,000,000,000: 101010101010101 ... 123456789898989  (6,225 numbers)
Base 10 esthetic numbers between 100,000,000,000,000,000 and 130,000,000,000,000,000: 101010101010101010 ... 123456789898989898  (44,744 numbers)
Base 10 esthetic numbers between 100,000,000,000,000,000,000 and 130,000,000,000,000,000,000: 101010101010101010101 ... 123456789898989898989  (312,019 numbers)

Raku

Works with: Rakudo version 2020.02

<lang perl6>use Lingua::EN::Numbers;

sub esthetic($base = 10) {

   my @s = ^$base .map: -> \s {
       ((s - 1).base($base) if s > 0), ((s + 1).base($base) if s < $base - 1)
   }
   flat [ (1 .. $base - 1)».base($base) ],
   { [ flat .map: { $_ xx * Z~ flat @s[.comb.tail.parse-base($base)] } ] } … *

}

for 2 .. 16 -> $b {

   put "\n{(4 × $b).&ordinal-digit} through {(6 × $b).&ordinal-digit} esthetic numbers in base $b";
   put esthetic($b)[(4 × $b - 1) .. (6 × $b - 1)]».fmt('%3s').batch(16).join: "\n"

}

my @e10 = esthetic; put "\nBase 10 esthetic numbers between 1,000 and 9,999:"; put @e10.&between(1000, 9999).batch(20).join: "\n";

put "\nBase 10 esthetic numbers between {1e8.Int.&comma} and {1.3e8.Int.&comma}:"; put @e10.&between(1e8.Int, 1.3e8.Int).batch(9).join: "\n";

sub between (@array, Int $lo, Int $hi) {

   my $top = @array.first: * > $hi, :k;
   @array[^$top].grep: * > $lo

}</lang>

Output:
8th through 12th esthetic numbers in base 2
10101010 101010101 1010101010 10101010101 101010101010

12th through 18th esthetic numbers in base 3
1210 1212 2101 2121 10101 10121 12101

16th through 24th esthetic numbers in base 4
323 1010 1012 1210 1212 1232 2101 2121 2123

20th through 30th esthetic numbers in base 5
323 343 432 434 1010 1012 1210 1212 1232 1234 2101

24th through 36th esthetic numbers in base 6
343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234

28th through 42nd esthetic numbers in base 7
345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232

32nd through 48th esthetic numbers in base 8
432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210
1212

36th through 54th esthetic numbers in base 9
434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878
1010 1012 1210

40th through 60th esthetic numbers in base 10
454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878
898 987 989 1010 1012

44th through 66th esthetic numbers in base 11
456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898
89A 987 989 9A9 A98 A9A 1010

48th through 72nd esthetic numbers in base 12
543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A
987 989 9A9 9AB A98 A9A ABA BA9 BAB

52nd through 78th esthetic numbers in base 13
545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987
989 9A9 9AB A98 A9A ABA ABC BA9 BAB BCB CBA

56th through 84th esthetic numbers in base 14
565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989
9A9 9AB A98 A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC

60th through 90th esthetic numbers in base 15
567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9
9AB A98 A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC CDE DCB DCD

64th through 96th esthetic numbers in base 16
654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB
A98 A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC CDE DCB DCD DED DEF
EDC

Base 10 esthetic numbers between 1,000 and 9,999:
1010 1012 1210 1212 1232 1234 2101 2121 2123 2321 2323 2343 2345 3210 3212 3232 3234 3432 3434 3454
3456 4321 4323 4343 4345 4543 4545 4565 4567 5432 5434 5454 5456 5654 5656 5676 5678 6543 6545 6565
6567 6765 6767 6787 6789 7654 7656 7676 7678 7876 7878 7898 8765 8767 8787 8789 8987 8989 9876 9878
9898

Base 10 esthetic numbers between 100,000,000 and 130,000,000:
101010101 101010121 101010123 101012101 101012121 101012123 101012321 101012323 101012343
101012345 101210101 101210121 101210123 101212101 101212121 101212123 101212321 101212323
101212343 101212345 101232101 101232121 101232123 101232321 101232323 101232343 101232345
101234321 101234323 101234343 101234345 101234543 101234545 101234565 101234567 121010101
121010121 121010123 121012101 121012121 121012123 121012321 121012323 121012343 121012345
121210101 121210121 121210123 121212101 121212121 121212123 121212321 121212323 121212343
121212345 121232101 121232121 121232123 121232321 121232323 121232343 121232345 121234321
121234323 121234343 121234345 121234543 121234545 121234565 121234567 123210101 123210121
123210123 123212101 123212121 123212123 123212321 123212323 123212343 123212345 123232101
123232121 123232123 123232321 123232323 123232343 123232345 123234321 123234323 123234343
123234345 123234543 123234545 123234565 123234567 123432101 123432121 123432123 123432321
123432323 123432343 123432345 123434321 123434323 123434343 123434345 123434543 123434545
123434565 123434567 123454321 123454323 123454343 123454345 123454543 123454545 123454565
123454567 123456543 123456545 123456565 123456567 123456765 123456767 123456787 123456789

REXX

<lang rexx>/*REXX pgm lists a bunch of esthetic numbers in bases 2 ──► 16, & base 10 in two ranges.*/ parse arg baseL baseH range /*obtain optional arguments from the CL*/ if baseL== | baseL=="," then baseL= 2 /*Not specified? Then use the default.*/ if baseH== | baseH=="," then baseH=16 /* " " " " " " */ if range== | range=="," then range=1000..9999 /* " " " " " " */

    do radix=baseL  to baseH;      #= 0         /*process the specified bases.         */
    start= radix * 4
    stop = radix * 6
    $=;               do i=1  until #==stop;  y= base(i, radix)   /*convert I to base Y*/
                      if \esthetic(y, radix)  then iterate        /*not esthetic?  Skip*/
                      #= # + 1;   if #<start  then iterate        /*is  #  below range?*/
                      $= $ y                                      /*append # to $ list.*/
                      end   /*i*/
    say
    say center(' base '  radix",  the" th(start)   '──►'   th(stop) ,
               "esthetic numbers ",  max(80, length($) - 1),  '─')
    say strip($)
    end   /*radix*/

say; g= 25 parse var range start '..' stop say center(' base 10 esthetic numbers between' start "and" stop '(inclusive) ', g*5-1,"─")

                                                                #= 0;        $=
    do k=start  to  stop;  if \esthetic(k, 10)  then iterate;   #= # + 1;    $= $ k
    if #//g==0  then do;  say strip($);  $=;  end
    end   /*k*/

say strip($) say; say # ' esthetic numbers listed.' exit /*stick a fork in it, we're all done. */ /*──────────────────────────────────────────────────────────────────────────────────────*/ PorA: _= pos(z, @u); p= substr(@u, _-1, 1); a= substr(@u, _+1, 1); return th: parse arg th; return th || word('th st nd rd', 1+(th//10)*(th//100%10\==1)*(th//10<4)) vv: parse arg v,_; vr= x2d(v) + _; if vr==-1 then vr= r; return d2x(vr) /*──────────────────────────────────────────────────────────────────────────────────────*/ base: procedure expose @u; arg x 1 #,toB,inB,,y /*Y is assigned a "null" value. */

     if tob==  then tob= 10                   /*maybe assign a default for TObase.   */
     if inb==  then inb= 10                   /*  "      "   "    "     "  INbase.   */
     @l= '0123456789abcdef';  @u= @l;  upper @u /*two versions of hexadecimal digits.  */
     if inB\==10  then                          /*only convert if  not  base 10.       */
        do;  #= 0                               /*result of converted  X  (in base 10).*/
          do j=1  for length(x)                 /*convert  X:   base inB  ──► base 10. */
          #= # * inB + pos(substr(x,j,1), @u)-1 /*build a new number,  digit by digit. */
          end    /*j*/                          /* [↑]  this also verifies digits.     */
        end
     if toB==10  then return #                  /*if TOB is ten,  then simply return #.*/
        do  while  # >= toB                     /*convert #:    base 10  ──►  base toB.*/
        y= substr(@l, (# // toB) + 1, 1)y       /*construct the output number.         */
        #= # % toB                              /*      ··· and whittle  #  down also. */
        end    /*while*/                        /* [↑]  algorithm may leave a residual.*/
     return substr(@l, # + 1, 1)y               /*prepend the residual, if any.        */

/*──────────────────────────────────────────────────────────────────────────────────────*/ esthetic: procedure expose @u; arg x,r; L= length(x); if L==1 then return 1

                do d=0  to r-1;  _= d2x(d);  if pos(_ || _, x)\==0  then return 0
                end   /*d*/                     /* [↑]  check for a duplicated digits. */
           do j=1  for L;  @.j= substr(x, j, 1) /*assign (base) digits to stemmed array*/
           end   /*j*/
         if L==2  then do;  z= @.1;  call PorA
                            if @.2==p | @.2==a  then nop;  else return 0
                       end
           do e=2  to L-1;  z= @.e;   pe= e-1;        ae= e+1
           if (z==vv(@.pe,-1)|z==vv(@.pe,1))&(z==vv(@.ae,-1)|z==vv(@.ae,1))  then iterate
           return 0
           end   /*e*/;         return 1</lang>
output   when using the default inputs:
───────────────── base  2,  the 8th ──► 12th esthetic numbers ──────────────────
10101010 101010101 1010101010 10101010101 101010101010

───────────────── base  3,  the 12th ──► 18th esthetic numbers ─────────────────
1210 1212 2101 2121 10101 10121 12101

───────────────── base  4,  the 16th ──► 24th esthetic numbers ─────────────────
323 1010 1012 1210 1212 1232 2101 2121 2123

───────────────── base  5,  the 20th ──► 30th esthetic numbers ─────────────────
323 343 432 434 1010 1012 1210 1212 1232 1234 2101

───────────────── base  6,  the 24th ──► 36th esthetic numbers ─────────────────
343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234

───────────────── base  7,  the 28th ──► 42nd esthetic numbers ─────────────────
345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232

───────────────── base  8,  the 32nd ──► 48th esthetic numbers ─────────────────
432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210 1212

───────────────── base  9,  the 36th ──► 54th esthetic numbers ─────────────────
434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878 1010 1012 1210

─────────────────── base  10,  the 40th ──► 60th esthetic numbers ───────────────────
454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 987 989 1010 1012

────────────────────── base  11,  the 44th ──► 66th esthetic numbers ───────────────────────
456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 a98 a9a 1010

────────────────────────── base  12,  the 48th ──► 72nd esthetic numbers ──────────────────────────
543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba ba9 bab

────────────────────────────── base  13,  the 52nd ──► 78th esthetic numbers ──────────────────────────────
545 565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb cba

────────────────────────────────── base  14,  the 56th ──► 84th esthetic numbers ──────────────────────────────────
565 567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc

────────────────────────────────────── base  15,  the 60th ──► 90th esthetic numbers ──────────────────────────────────────
567 654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd

────────────────────────────────────────── base  16,  the 64th ──► 96th esthetic numbers ──────────────────────────────────────────
654 656 676 678 765 767 787 789 876 878 898 89a 987 989 9a9 9ab a98 a9a aba abc ba9 bab bcb bcd cba cbc cdc cde dcb dcd ded def edc

──────────────────────────────── base 10 esthetic numbers between 1000 and 9999 (inclusive) ────────────────────────────────
1010 1012 1210 1212 1232 1234 2101 2121 2123 2321 2323 2343 2345 3210 3212 3232 3234 3432 3434 3454 3456 4321 4323 4343 4345
4543 4545 4565 4567 5432 5434 5454 5456 5654 5656 5676 5678 6543 6545 6565 6567 6765 6767 6787 6789 7654 7656 7676 7678 7876
7878 7898 8765 8767 8787 8789 8987 8989 9876 9878 9898

61  esthetic numbers listed.