kececinumbers 0.3.6__tar.gz → 0.3.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kececinumbers
3
- Version: 0.3.6
3
+ Version: 0.3.8
4
4
  Summary: Keçeci Numbers: An Exploration of a Dynamic Sequence Across Diverse Number Sets
5
5
  Home-page: https://github.com/WhiteSymmetry/kececinumbers
6
6
  Author: Mehmet Keçeci
@@ -20,7 +20,7 @@ import warnings
20
20
  # importlib.reload(kececinumbers) # F821 undefined name 'kececinumbers'
21
21
 
22
22
  # Paket sürüm numarası
23
- __version__ = "0.3.6"
23
+ __version__ = "0.3.8"
24
24
  __author__ = "Mehmet Keçeci"
25
25
  __email__ = "mkececi@yaani.com"
26
26
 
@@ -41,6 +41,7 @@ __all__ = [
41
41
  # --- Core Generation and Analysis ---
42
42
  'unified_generator',
43
43
  'is_prime',
44
+ 'find_period',
44
45
  'find_kececi_prime_number',
45
46
 
46
47
  # --- Visualization and Reporting ---
@@ -82,6 +83,7 @@ try:
82
83
  get_random_type,
83
84
  unified_generator,
84
85
  is_prime,
86
+ find_period,
85
87
  find_kececi_prime_number,
86
88
  plot_numbers,
87
89
  print_detailed_report,
@@ -1,6 +1,6 @@
1
1
  # _version.py
2
2
 
3
- __version__ = "0.3.6"
3
+ __version__ = "0.3.8"
4
4
  __license__ = "MIT"
5
5
  __description__ = "Keçeci Numbers: An Exploration of a Dynamic Sequence Across Diverse Number Sets."
6
6
  __author__ = "Mehmet Keçeci"
@@ -693,6 +693,46 @@ def get_interactive() -> Tuple[List[Any], Dict[str, Any]]:
693
693
  # --- ANALYSIS AND PLOTTING ---
694
694
  # ==============================================================================
695
695
 
696
+ def find_period(sequence: List[Any], min_repeats: int = 3) -> Optional[List[Any]]:
697
+ """
698
+ Checks if the end of a sequence has a repeating cycle (period).
699
+
700
+ Args:
701
+ sequence: The list of numbers to check.
702
+ min_repeats: How many times the cycle must repeat to be considered stable.
703
+
704
+ Returns:
705
+ The repeating cycle as a list if found, otherwise None.
706
+ """
707
+ if len(sequence) < 10: # Çok kısa dizilerde periyot aramak anlamsız
708
+ return None
709
+
710
+ # Olası periyot uzunluklarını dizinin yarısına kadar kontrol et
711
+ for p_len in range(1, len(sequence) // min_repeats):
712
+ # Dizinin sonundan potansiyel döngüyü al
713
+ candidate_cycle = sequence[-p_len:]
714
+
715
+ # Döngünün en az `min_repeats` defa tekrar edip etmediğini kontrol et
716
+ is_periodic = True
717
+ for i in range(1, min_repeats):
718
+ start_index = -(i + 1) * p_len
719
+ end_index = -i * p_len
720
+
721
+ # Dizinin o bölümünü al
722
+ previous_block = sequence[start_index:end_index]
723
+
724
+ # Eğer bloklar uyuşmuyorsa, bu periyot değildir
725
+ if candidate_cycle != previous_block:
726
+ is_periodic = False
727
+ break
728
+
729
+ # Eğer döngü tüm kontrollerden geçtiyse, periyodu bulduk demektir
730
+ if is_periodic:
731
+ return candidate_cycle
732
+
733
+ # Hiçbir periyot bulunamadı
734
+ return None
735
+
696
736
  def find_kececi_prime_number(kececi_numbers_list: List[Any]) -> Optional[int]:
697
737
  """Finds the Keçeci Prime Number from a generated sequence."""
698
738
  if not kececi_numbers_list:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kececinumbers
3
- Version: 0.3.6
3
+ Version: 0.3.8
4
4
  Summary: Keçeci Numbers: An Exploration of a Dynamic Sequence Across Diverse Number Sets
5
5
  Home-page: https://github.com/WhiteSymmetry/kececinumbers
6
6
  Author: Mehmet Keçeci
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  setup(
5
5
  name="kececinumbers",
6
- version="0.3.6",
6
+ version="0.3.8",
7
7
  description="Keçeci Numbers: An Exploration of a Dynamic Sequence Across Diverse Number Sets",
8
8
  long_description=open("README.md").read(),
9
9
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes