[PR #109] [CLOSED] New Algorithm - Repeating_1's_Square #337

Open
opened 2026-01-29 15:11:48 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/TheAlgorithms/C/pull/109
Author: @ghodakegitanjali
Created: 12/17/2017
Status: Closed

Base: masterHead: re


📝 Commits (2)

  • 90fac7c Create Repeating_1's_Square
  • 6145329 Update Repeating_1's_Square

📊 Changes

1 file changed (+109 additions, -0 deletions)

View changed files

Repeating_1's_Square (+109 -0)

📄 Description

Added new algorithm to MISC. Fix for issue "Add more algorithms".

This program accepts user input of number of consecutive/repeating 1's. And then calculates it's square.
E.g. If user enters number of consecutive 1's = 5 then it calculates (11111)^2 = 123454321.
User may enter any number of consecutive 1's to be squared (less than or equal to 2^32 - 1).
This program uses innovative logic & pattern recognition to calculate the result within fraction of seconds.
Without this approach high end computers may also take few hours to calculate it. The result is calculated in three parts ' front' 'middle' & 'back'.
Similarly in future this can be extended with a logic to calculate the square of other consecutive/repeating numbers.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TheAlgorithms/C/pull/109 **Author:** [@ghodakegitanjali](https://github.com/ghodakegitanjali) **Created:** 12/17/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `re` --- ### 📝 Commits (2) - [`90fac7c`](https://github.com/TheAlgorithms/C/commit/90fac7ca91b43985de5bf66e5541000f79d9341c) Create Repeating_1's_Square - [`6145329`](https://github.com/TheAlgorithms/C/commit/6145329591e48e0ba828227c7bf89bbd2bff84d3) Update Repeating_1's_Square ### 📊 Changes **1 file changed** (+109 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `Repeating_1's_Square` (+109 -0) </details> ### 📄 Description Added new algorithm to MISC. Fix for issue "Add more algorithms". This program accepts user input of number of consecutive/repeating 1's. And then calculates it's square. E.g. If user enters number of consecutive 1's = 5 then it calculates (11111)^2 = 123454321. User may enter any number of consecutive 1's to be squared (less than or equal to 2^32 - 1). This program uses innovative logic & pattern recognition to calculate the result within fraction of seconds. Without this approach high end computers may also take few hours to calculate it. The result is calculated in three parts ' front' 'middle' & 'back'. Similarly in future this can be extended with a logic to calculate the square of other consecutive/repeating numbers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:11:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#337