ACC's Math Conjecture II

Another one for posterity:


If N=31622777, then N^3 = 31622777796632428411433, and that's the largest N that has such a property.

I have tested this conjecture up to N's 100-digits long, and it holds true. Used the code below.
If you can find a larger N, let me know.
Thanks, ACC.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;
namespace SquareStart
{
 class Program
 {
 static void Main(string[] args)
 {
 int power = Int32.Parse(args[0]);
 BigInteger factor = 1;
 BigInteger MAX = 1000000;
 BigInteger count = 0;
 for (BigInteger n = 1; ; n++, count++)
 {
 if (n % 10 != 0 && (BigInteger.Pow(n, power)).ToString().StartsWith(n.ToString()))
 {
 Console.WriteLine("{0} => {1}", n, BigInteger.Pow(n, power));
 BigInteger temp = n;
 n = 10 * n - factor;
 if (n <= temp)
 {
 n = temp;
 }
 else
 {
 factor *= 10;
 }
 count = 0;
 }
 if (count >= MAX)
 {
 n *= 10;
 count = 0;
 Console.Write("{0}-", n.ToString().Length);
 }
 }
 }
 }
}

Comments

  1. Well, it's easy to find at least one number with arbitrary length for which this property holds true - any power of 10 :) Here is my napkin-style Python script that prints all such numbers and makes it very obvious that any power of 10 always fits the bill :)

    for i in range(10**1000):
    if str(i ** 3).startswith(str(i)):
    print(i, i**3)

    0 0
    1 1
    10 1000
    32 32768
    100 1000000
    1000 1000000000
    10000 1000000000000
    31623 31623446801367
    100000 1000000000000000
    316228 31622846796684352
    1000000 1000000000000000000
    3162278 31622786796633508952
    10000000 1000000000000000000000
    31622777 31622777796632428411433
    100000000 1000000000000000000000000

    Reply Delete
  2. Wie wär's mit 316227766017? 31622776601^3=31622776601732413360022154029126
    oder 316227766016838^3=31622776601683813360022129111349862592192472

    Reply Delete
  3. Miracle173: I guess the problem's been solved :) Good job!!!

    Reply Delete
  4. einfach die Ziffern von 10^0.5 nehmen. Diese Wurzel kann man z.B. hier (https://www.ttmath.org/online_calculator) berechnen. Dann findet man z.B.

    316227766016837933199889354443271853371955513932521682685750485279259443863923822134424810837930029518734728415284005514854885603045388001469051959670015390334492165717925994065915015347411333948412408531692957709047157646104436925787906203780860994182837171154840632855299911859682456420332696160469131433612894979189027^3 = 31622776601683793319988935444327185337195551393252168268575048527925944386392382213442481083793002951873472841528400551485488560304538800146905195967001539033449216571792599406591501534741133394841240853169295770904715764610443692578790620378086099418283717115484063285529991185968245642033269616046913143361289497918902769409127746476424372998772236274428390726337300950439377124613306560523609736286431935375164091955633839082543107707994928448405943427119419511840442079309120216733015546947758644146966479379031266044124861476885589992602101810611562999852833023107122345377814217819153038915286931921854519604269125481207165479973860200095144367860768079216739417320940438348635868789195186885141279651353875619216981657040907404475657787785785828175923925174846559126447745292267007331960857567949514398539137781848120134336213196224279280093116123725767418602571473583480804020163991852839938793882772549236048118970510860691652596864884863920503887362683

    Reply Delete

Post a Comment

[フレーム]

Popular posts from this blog

Quasi FSM (Finite State Machine) problem + Vibe

Not really an FSM problem since the state isn't changing, it is just defined by the current input. Simply following the instructions should do it. Using VSCode IDE you can also engage the help of Cline or Copilot for a combo of coding and vibe coding, see below screenshot. Cheers, ACC. Process String with Special Operations I - LeetCode You are given a string  s  consisting of lowercase English letters and the special characters:  * ,  # , and  % . Build a new string  result  by processing  s  according to the following rules from left to right: If the letter is a  lowercase  English letter append it to  result . A  '*'   removes  the last character from  result , if it exists. A  '#'   duplicates  the current  result  and  appends  it to itself. A  '%'   reverses  the current  result . Return the final string  result  after processing all char...

Shortest Bridge – A BFS Story (with a Twist)

Here's another one from the Google 30 Days challenge on LeetCode — 934. Shortest Bridge . The goal? Given a 2D binary grid where two islands (groups of 1s) are separated by water (0s), flip the fewest number of 0s to 1s to connect them. Easy to describe. Sneaky to implement well. 🧭 My Approach My solution follows a two-phase Breadth-First Search (BFS) strategy: Find and mark one island : I start by scanning the grid until I find the first 1 , then use BFS to mark all connected land cells as 2 . I store their positions for later use. Bridge-building BFS : For each cell in the marked island, I run a BFS looking for the second island. Each BFS stops as soon as it hits a cell with value 1 . The minimum distance across all these searches gives the shortest bridge. 🔍 Code Snippet Here's the core logic simplified: public int ShortestBridge(int[][] grid) { // 1. Mark one island as '2' and gather its coordinates List<int> island = FindAndMark...

Classic Dynamic Programming IX

A bit of vibe code together with OpenAI O3. I asked O3 to just generate the sieve due to laziness. Sieve is used to calculate the first M primes (when I was using Miller-Rabin, was giving me TLE). The DP follows from that in a straightforward way: calculate the numbers from i..n-1, then n follows by calculating the min over all M primes. Notice that I made use of Goldbach's Conjecture as a way to optimize the code too. Goldbach's Conjecture estates that any even number greater than 2 is the sum of 2 primes. The conjecture is applied in the highlighted line. Cheers, ACC. PS: the prompt for the sieve was the following, again using Open AI O3 Advanced Reasoning: " give me a sieve to find the first M prime numbers in C#. The code should produce a List<int> with the first M primes " Minimum Number of Primes to Sum to Target - LeetCode You are given two integers  n  and  m . You have to select a multiset of  prime numbers  from the  first   m  pri...