{"id":35174957,"url":"https://github.com/aaronsb/fizzbuzztensor","last_synced_at":"2026-05-17T21:35:37.787Z","repository":{"id":325501569,"uuid":"1101429725","full_name":"aaronsb/fizzbuzztensor","owner":"aaronsb","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-23T06:31:08.000Z","size":2274,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-31T12:08:30.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaronsb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-21T16:57:23.000Z","updated_at":"2025-11-23T06:31:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aaronsb/fizzbuzztensor","commit_stats":null,"previous_names":["aaronsb/fizzbuzztensor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aaronsb/fizzbuzztensor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Ffizzbuzztensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Ffizzbuzztensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Ffizzbuzztensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Ffizzbuzztensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronsb","download_url":"https://codeload.github.com/aaronsb/fizzbuzztensor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Ffizzbuzztensor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33155819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-28T22:07:08.283Z","updated_at":"2026-05-17T21:35:37.782Z","avatar_url":"https://github.com/aaronsb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TensorFizzBuzz 🎵\n\n\u003e *\"The most elemental solution to FizzBuzz is not an algorithm, but a number: 15.\"*\n\nA tensor-based approach to FizzBuzz that reveals its underlying mathematical structure as a periodic signal.\n\n## Three Approaches, Three Problems\n\nThis project explores FizzBuzz through three different tensor representations, each optimized for a different use case:\n\n### 1. Pattern Vector (15 elements) - Fast Sequential Access\n```python\nPATTERN = [0, 0, 1, 0, 2, 1, 0, 0, 1, 2, 0, 1, 0, 0, 3]\ncategory = PATTERN[(n-1) % 15]  # O(1) lookup, 1 modulo operation\n```\n**Best for:** Sequential iteration, simple indexing\n**Visualization:** Signal processing view (waveform, FFT, 2D heatmap)\n\n### 2. Compact Binary Matrix (4 elements) - Minimal Storage\n```python\nPATTERN_COMPACT = [[0, 2],  # 73% storage reduction\n                   [1, 3]]\ncategory = PATTERN_COMPACT[n%3==0][n%5==0]  # 2 modulo operations\n```\n**Best for:** Memory-constrained environments, embedded systems\n**Visualization:** 2×2 heatmap showing binary divisibility structure\n\n### 3. Batched 3D Tensor - Parallel Computation\n```python\n# Shape: (batch_size, sequence_length, n_divisors)\n# Compute multiple sequences simultaneously\nresult, div_tensor = fizzbuzz_batched(batch_size=10, sequence_length=100)\n```\n**Best for:** Distributed computing, GPU acceleration, processing multiple ranges\n**Visualization:** 3D structure showing parallel batch computation\n\n## Quick Start\n\n```python\nfrom fizzbuzz import fizzbuzz, print_fizzbuzz\n\n# Generate FizzBuzz 1-100\nresult = fizzbuzz(100)\n\n# Print it\nprint_fizzbuzz(30)\n```\n\n## Visualizations\n\n### Pattern Vector Approach (Signal Processing)\n![Waveform](docs/images/fizzbuzz_waveform.png)\n![Frequency Spectrum](docs/images/fizzbuzz_fft.png)\n\n### Compact Binary Matrix Approach (Minimal Storage)\n![Compact Matrix](docs/images/fizzbuzz_compact.png)\n\n### Batched 3D Tensor Approach (Parallel Computation)\n![3D Structure](docs/images/fizzbuzz_3d_structure.png)\n\nGenerate all visualizations:\n```bash\npython visualize.py           # Pattern vector approach\npython visualize_compact.py   # Compact matrix\npython visualize_batched.py   # Batched 3D tensor\n```\n\n## The Paper\n\nRead the full analysis: [TensorFizzBuzz: A Signal Processing Approach](docs/tensor-fizzbuzz-paper.md)\n\nTopics covered:\n- Pattern vector representation (15-element sequential)\n- Compact binary matrix (4-element compression)\n- Batched 3D tensors (parallel computation)\n- Rank-2 divisibility matrices and dimensional compression\n- Frequency domain analysis (FFT)\n- Trigonometric representations\n- Generalization to arbitrary divisors\n- Computational complexity analysis\n\n## Generalization\n\nWorks for any divisor set! Example with divisors {3, 5, 7}:\n\n```python\nfrom fizzbuzz import create_pattern\n\npattern, decoder = create_pattern([(3, \"Fizz\"), (5, \"Buzz\"), (7, \"Bazz\")])\n# Period = LCM(3,5,7) = 105\n# Outputs: \"Fizz\", \"Buzz\", \"Bazz\", \"FizzBuzz\", \"FizzBazz\", \"BuzzBazz\", \"FizzBuzzBazz\"\n```\n\n## Installation\n\n```bash\npip install numpy matplotlib\npython fizzbuzz.py\n```\n\n## Inspiration\n\nThis work was inspired by Susam Pal's elegant [\"Fizz Buzz With Cosines\"](https://susam.net/fizz-buzz-with-cosines.html), which demonstrated that FizzBuzz can be solved using trigonometric functions. This raised the question: **if FizzBuzz is fundamentally a periodic function, why not represent it as a first-class tensor?**\n\n## License\n\nMIT\n\n## Contributing\n\nThis started as a silly exploration - \"what if we took FizzBuzz way too seriously?\" - and became a genuine investigation into periodic signals and tensor representations. PRs welcome for additional visualizations, optimizations, or generalizations!\n\n---\n\n*Because sometimes the best way to solve a problem is to completely overengineer it.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronsb%2Ffizzbuzztensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronsb%2Ffizzbuzztensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronsb%2Ffizzbuzztensor/lists"}