login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A173646 Fixed points of the operation x->(max_d(x)+min_d(x))/2, where max_d(x) iteratively replaces each digit d of x from left to right with the largest of the d digits to its right (itself included), and similarly for min_d. 1
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 33, 44, 55, 66, 77, 88, 99, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 133, 144, 155, 166, 177, 188, 199, 222, 315, 333, 417, 444, 519, 555, 666, 777, 888, 999, 1111, 1112, 1113, 1114 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Note that for most x, min_d(x) + max_d(x) is even; multiples of 10 whose least significant nonzero digit is 3,5,7, or 9 appear to be exceptions.
LINKS
E. Angelini, n' = (MAXd+MINd)/2
E. Angelini, n' = (MAXd+MINd)/2 [Cached copy, with permission]
EXAMPLE
The max_d and min_d operations work as follows. Consider max_d(x) for x=723810; we read x from left to right, digit by digit. We replace the 7 with the biggest of the 7 digits on its right (including itself), which is 8, producing 823810. We replace the 2 with the biggest of the 2 digits on its right (including itself), so 2 is replaced by 3, producing 833810. Applying the same rule to the third-digit 3 gives 838810; to the 8 gives 838810 (no change); the 1 is replaced by itself, again giving 838810; and then the 0 is replaced by the largest of the 0 digits to its right (including itself), but since there are none the 0 is replaced by nothing, giving 83881. Therefore max_d(723810) = 83881. min_d(x) works in similar fashion, but replacing each digit with the smallest digit to its right including itself.
The sequence consists of those x such that x = (min_d(x) + max_d(x))/2, such as 1519, where 1519 = (1119+1919)/2 = 3038/2 = 1519.
MATHEMATICA
MAXd(n)={ for(i=1, #n=Vecsmall(Str(n)), if( n[i]>48, for(j=i+1, min(#n, i+n[i]-49),
n[j]>n[i] & n[i]=n[j]), n[i]=32)); eval(Strchr(n)) }
MINd(n)={ for(i=1, #n=Vecsmall(Str(n)), if( n[i]>48, for(j=i+1, min(#n, i+n[i]-49),
n[j]<n[i] & n[i]=n[j]), n[i]=32)); eval(Strchr(n)) }
EA(n)=(MAXd(n)+MINd(n))/2
for(n=1, 99999, EA(n)==n & print1(n", ")) (* Code due to M. F. Hasler, attribution by D. S. McNeil, Nov 24 2010 *)
CROSSREFS
Sequence in context: A055571 A132781 A318275 * A274125 A070698 A243079
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Nov 24 2010
EXTENSIONS
Edited by D. S. McNeil, Nov 24 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 07:32 EDT 2024. Contains 372346 sequences. (Running on oeis4.)