The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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

%I #26 Feb 27 2020 22:46:26

%S 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,

%T 111,112,113,114,115,116,117,118,119,122,133,144,155,166,177,188,199,

%U 222,315,333,417,444,519,555,666,777,888,999,1111,1112,1113,1114

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

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

%H E. Angelini, <a href="http://www.cetteadressecomportecinquantesignes.com/MAXdMINd.htm">n' = (MAXd+MINd)/2</a>

%H E. Angelini, <a href="/A173646/a173646.pdf">n' = (MAXd+MINd)/2</a> [Cached copy, with permission]

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

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

%t MAXd(n)={ for(i=1,#n=Vecsmall(Str(n)), if( n[i]>48, for(j=i+1,min(#n,i+n[i]-49),

%t n[j]>n[i] & n[i]=n[j]), n[i]=32)); eval(Strchr(n)) }

%t MINd(n)={ for(i=1,#n=Vecsmall(Str(n)), if( n[i]>48, for(j=i+1,min(#n,i+n[i]-49),

%t n[j]<n[i] & n[i]=n[j]), n[i]=32)); eval(Strchr(n)) }

%t EA(n)=(MAXd(n)+MINd(n))/2

%t for(n=1,99999,EA(n)==n & print1(n", ")) (* Code due to _M. F. Hasler_, attribution by _D. S. McNeil_, Nov 24 2010 *)

%K nonn,base

%O 1,2

%A _Eric Angelini_, Nov 24 2010

%E Edited by _D. S. McNeil_, Nov 24 2010

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 June 1 15:30 EDT 2024. Contains 373025 sequences. (Running on oeis4.)