code: 
  
  
  from __future__ import annotations
  
  
  
  
  def 			__lowercase	(						_UpperCamelCase     )    ->list[int]:
  
  
  
  
  
  
  
        """simple docstring"""
  
        lowercase			:   int					   =		[0] * max_one
  
        for i in range(0,    _UpperCamelCase     ):
              lowercase			:   List[Any]					   =		i
  
        for i in range(2,    _UpperCamelCase     ):
              if totients[i] == i:
                    for j in range(_UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase     ):
                          totients[j] -= totients[j] // i
  
        return totients
  
  
  
  
  def 			__lowercase	(						_UpperCamelCase,    _UpperCamelCase     )    ->bool:
  
  
  
  
  
  
  
        """simple docstring"""
  
        return sorted(str(_UpperCamelCase     )     ) == sorted(str(_UpperCamelCase     )     )
  
  
  
  
  def 			__lowercase	(						_UpperCamelCase = 10000000     )    ->int:
  
  
  
  
  
  
  
        """simple docstring"""
  
        lowercase			:   List[Any]					   =		1  # i
        lowercase			:   Optional[int]					   =		0  # φ(i)
        lowercase			:   List[str]					   =		get_totients(max_n + 1     )
  
        for i in range(2,    max_n + 1     ):
              lowercase			:   Any					   =		totients[i]
  
              if i * min_denominator < min_numerator * t and has_same_digits(_UpperCamelCase,    _UpperCamelCase     ):
                    lowercase			:   str					   =		i
                    lowercase			:   List[str]					   =		t
  
        return min_numerator
  
  
  if __name__ == "__main__":
    print(F'''{solution() = }''')
  
  
style_context: 
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available
  
  
  __a   				=      {
      '''configuration_decision_transformer''': [
          '''DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
          '''DecisionTransformerConfig''',
      ],
  }
  
  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    __a   				=      [
        '''DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
        '''DecisionTransformerGPT2Model''',
        '''DecisionTransformerGPT2PreTrainedModel''',
        '''DecisionTransformerModel''',
        '''DecisionTransformerPreTrainedModel''',
    ]
  
  
  if TYPE_CHECKING:
    from .configuration_decision_transformer import (
        DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
        DecisionTransformerConfig,
    )
  
    try:
      if not is_torch_available():
        raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
      pass
    else:
      from .modeling_decision_transformer import (
          DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          DecisionTransformerGPTaModel,
          DecisionTransformerGPTaPreTrainedModel,
          DecisionTransformerModel,
          DecisionTransformerPreTrainedModel,
      )
  
  
  else:
    import sys
  
    __a   				=      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
  
  