Skip to content

DennisFFM/Fibonacci-Suite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fibo Suite

A comprehensive Fibonacci calculation and analysis tool with advanced features for mathematical exploration, visualization, and data export.

🌟 Features

Core Functionality

  • Standard Fibonacci Sequences - Calculate classic Fibonacci numbers starting from 1
  • Custom Start Values - Generate sequences from any valid Fibonacci number
  • Arbitrary Precision - Handle numbers with millions of digits using Decimal arithmetic
  • Iterative Calculation - Memory-efficient calculation for large sequences

Advanced Calculation Modes

  • Tribonacci Numbers - T(n) = T(n-1) + T(n-2) + T(n-3)
  • Lucas Numbers - L(n) = L(n-1) + L(n-2), L(0)=2, L(1)=1
  • Generalized Fibonacci - Custom start values a, b
  • Negative Fibonacci - F(-n) = (-1)^(n+1) * F(n)
  • Optimized Algorithms - Matrix exponentiation, fast doubling, Binet's formula

Mathematical Analysis

  • Golden Ratio Convergence - Analyze convergence to Ο† β‰ˆ 1.618033988749
  • Prime Number Properties - Identify prime numbers in sequences
  • Digital Roots - Calculate and analyze digital root patterns
  • Modulo Patterns - Study remainder patterns for various moduli
  • Palindrome Detection - Find palindromic numbers
  • Growth Rate Analysis - Analyze sequence growth characteristics

Visualization (requires matplotlib)

  • Growth Rate Graphs - Visualize convergence to golden ratio
  • Digit Count Evolution - Track number of digits over sequence
  • Modulo Pattern Plots - Visualize remainder patterns
  • Digital Root Cycles - Analyze digital root behavior
  • Golden Ratio Convergence - Plot convergence errors
  • Fibonacci Spiral - Experimental spiral visualization

Export Capabilities

  • JSON Export - Complete data with analysis results
  • CSV Export - Fibonacci numbers with indices and digit counts
  • LaTeX Export - Mathematical document with analysis
  • Binary Export - Compact binary data format

Interactive Features

  • Real-time Calculation - Live calculation with progress tracking
  • Interactive Explorer - Explore mathematical properties
  • Performance Testing - Compare algorithm efficiency
  • Mathematical Experiments - Conduct custom experiments

πŸš€ Installation

Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)

Basic Installation

# Clone the repository
git clone https://github.com/yourusername/fibo-suite.git
cd fibo-suite

# Create virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Optional Dependencies

For visualization features, install matplotlib:

pip install matplotlib numpy

πŸ“– Usage

Basic Usage

python fibosuite.py

Command Line Options

# Show help and available options
python fibosuite.py --help

# Calculate standard Fibonacci sequence
python fibosuite.py --standard --count 100

# Calculate with custom start value
python fibosuite.py --custom --start 8 --count 50

# Export to file
python fibosuite.py --export json --count 1000

# Analyze sequence
python fibosuite.py --analyze --count 500

# Export with custom output file
python fibosuite.py --export csv --count 100 --output my_fibonacci

Interactive Menu

The application provides an interactive menu with the following options:

  1. Standard Fibonacci Calculation - Classic Fibonacci sequences
  2. Extended Calculation Modes - Tribonacci, Lucas, generalized sequences
  3. Fibonacci Analysis - Mathematical property analysis
  4. Visualization - Create graphs and plots
  5. Export Functions - Export data in various formats
  6. Interactive Explorer - Real-time exploration and experiments

πŸ”§ Configuration

Precision Settings

The application uses high-precision arithmetic:

  • String conversion limit: 10 million digits
  • Decimal precision: 1 million digits

Memory Management

  • Iterative calculation for large sequences (>10,000 numbers)
  • Progress-only mode for very large calculations
  • Automatic memory optimization

πŸ“Š Examples

Standard Fibonacci Sequence

1. 1
2. 1
3. 2
4. 3
5. 5
6. 8
7. 13
8. 21
9. 34
10. 55

Golden Ratio Analysis

Golden Ratio Analysis:
   Last Ratio: 1.618033988749
   Theoretical Value: 1.618033988749
   Deviation: 0.000000000000

Export Example (JSON)

{
  "metadata": {
    "export_date": "2024-01-15T10:30:00",
    "number_count": 100,
    "largest_number": "354224848179261915075",
    "smallest_number": "1"
  },
  "sequence": [1, 1, 2, 3, 5, ...],
  "analysis": {
    "golden_ratio": {...},
    "prime_numbers": {...},
    "digital_roots": {...}
  }
}

πŸ§ͺ Mathematical Features

Golden Ratio Convergence

The ratio between consecutive Fibonacci numbers converges to the golden ratio Ο†:

Ο† = (1 + √5) / 2 β‰ˆ 1.618033988749

Prime Number Properties

  • Identify prime numbers in Fibonacci sequences
  • Calculate prime density
  • Find prime number positions

Digital Root Patterns

  • Calculate digital roots (sum of digits until single digit)
  • Analyze cyclic patterns
  • Identify most common digital roots

Modulo Analysis

  • Study remainder patterns for various moduli (2, 3, 5, 7, 10)
  • Identify cycle lengths
  • Analyze distribution patterns

πŸ“ˆ Performance

Algorithm Comparison

  • Standard Iteration: O(n) time, O(n) space
  • Matrix Exponentiation: O(log n) time, O(1) space
  • Fast Doubling: O(log n) time, O(1) space
  • Binet's Formula: O(1) time, O(1) space (approximation)

Memory Usage

  • Standard mode: Stores complete sequence
  • Iterative mode: Stores only last two numbers
  • Progress mode: Minimal memory usage

πŸ” Troubleshooting

Common Issues

Matplotlib not available:

⚠️  matplotlib not available - visualization disabled
πŸ’‘ Install matplotlib with: pip install matplotlib

Large number calculations:

  • Use iterative mode for sequences > 10,000 numbers
  • Enable progress-only mode for very large calculations
  • Monitor memory usage for extremely large sequences

Export errors:

  • Ensure write permissions in target directory
  • Check available disk space for large exports
  • Verify file path validity

🀝 Contributing

We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.

Development Setup

# Clone repository
git clone https://github.com/yourusername/fibo-suite.git
cd fibo-suite

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
python -m pytest tests/

# Run linting
python -m flake8 fibosuite.py

Code Style

  • Follow PEP 8 guidelines
  • Use descriptive variable names
  • Add docstrings for all functions
  • Include type hints where appropriate

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Mathematical concepts based on classical number theory
  • Visualization features powered by matplotlib
  • High-precision arithmetic using Python's Decimal module
  • Performance optimizations inspired by modern algorithmic techniques

πŸ“ž Support

If you encounter any issues or have questions:

  • Open an issue on GitHub
  • Check the documentation
  • Review the troubleshooting section

Fibo Suite - Exploring the mathematical beauty of Fibonacci sequences with modern computational power.

About

Fibo Suite - Exploring the mathematical beauty of Fibonacci sequences with modern computational power.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors