Page 2 of 2

Posted: Sat Apr 23, 2011 5:49 am
by FreeFull
bc, cat and a terminal window that tells you how wide and tall it is when you resize. Probably the easiest solution.

Calculation Was Easy

Posted: Sun May 15, 2011 10:17 pm
by Millennium
I did the calculations on a bignum calc in C++ that I had made long ago. I actually had added the option to display every xth digit. I just made a slight edit so that now I can choose what digit to start off of.

Posted: Mon Aug 15, 2011 11:50 pm
by BosseBL
lol...envy you phyton programmers. Im not gonna post my messy c++ code here.
I had to find a way to calculate the value part by part and store the answere in smaller bits in a vector.
must make a c++ class based on this problem, so I never have to mess with large number coding ever again.

Posted: Tue Feb 14, 2012 6:30 am
by Taurath
First thing I've written in 5 years, and first time ever using ruby. I could clean this up, but this is what I did to solve:

Code: Select all

y = ((17**39)**11)
y = y.to_s
z = 0
x = y[z].chr

while x != nil do
	puts x
	z = z + 33
	x = y[z].chr
	end
Of course, it pops a new number out each line. I know how to clean it now, but hey, its okay for a first run.

Posted: Thu Feb 23, 2012 9:57 pm
by Seplik
Hi all,

this is my solution in C# (.NET 4)

Code: Select all

using System;
using System.Numerics;

namespace ThePowerToBe
{
    class Program
    {
        static void Main(string[] args)
        {
            BigInteger ergebnis = BigInteger.Pow(17, 39 * 11);
            string tmp = ergebnis.ToString();

            for (int i = 0; i < tmp.Length; i++)
            {
                if (i % 33 == 0)
                {
                    Console.Write(tmp[i].ToString());
                }
            }

            Console.ReadLine();
        }
    }
}
Greets from Dresden

Seplik

Posted: Tue Mar 13, 2012 7:29 pm
by the_austria
I calculate all digits with wolframalpha.com and copy it in this JS code:

Code: Select all

var str="7287646047175693809181003658560624690001934249475037583383410966869968575
4467436227234724042627102964298841820516037233528475978459785414759364887185809727
4405592779889038847476635050174799866232012301434410796898542809249563904637123246
8838883439670635548482463420202788891164816364632521828315194205599067991807910869
8595734119712778333056577256424265140391245645531793341906275133082870098777864521
4725045780084668671936673752128478286140806951581228924388701768931419905595306419
093162717560756925359266275186144493274175697";

for (i=0;i<str.length;i+=33)
{
document.write(str.charAt(i));
}

Posted: Thu Mar 22, 2012 6:36 pm
by space
hobbist wrote:

Code: Select all

x = str(((17**39)**11)) 
x2 = ''
for i in range(0,len(x),33):
    x2 += x[i]
print 'powers that be ', x2

Gawd, I love python. Can't wait until I really start learning.
lol? :D
print str((17**39)**11)[::33]

Java is easy enough

Posted: Wed May 02, 2012 11:09 pm
by pedromalta
For the Math

Code: Select all

public BigInteger ThePowersThatBe(){
		
		BigInteger n17 = new BigInteger("17");
		return n17.pow(39).pow(11);
	}

And to concatenate each 33rd

Code: Select all

public String ThePowersThatBe(BigInteger result){
		String retorno = "";
		int pivot = 0;
		while (true){
			try{
				retorno += result.toString().substring(pivot, pivot+1);
				pivot+=33;
				
			}catch (StringIndexOutOfBoundsException e) {
				return retorno;
			}
			
		}
	}

Posted: Thu Nov 01, 2012 6:09 pm
by fuxx
b:string((17^39)^11), for a : 1 thru slength(b) do (if mod(a, 33)=1 then printf(true, "~c", charat(b, a)))$

Posted: Mon Aug 19, 2013 12:01 pm
by strongdrink
Vim FTW!!
Use bc to calculate the number, then in vim:
l32dl (Repeat 16 times) :D

This is confusing

Posted: Sun Jan 11, 2015 4:25 pm
by pgrigoruta
Hello, I easily understood what needs doing and implemented it with PHP bcmath. Yet after reading:

"Now take every 33rd digit of x, starting with the first (most significant), and stick them together."

I interpreted as "use digits 33, 66 etc", while it looks like the needed digits are 1, 34 etc. Luckily there are some hints in the not-done forum to clarify this, but since I look at hints as a last resort I ended up doing the calculation in multiple languages as I never suspected the issue was with correctly interpreting the challenge. I think a better challenge text would be:

"Take the first digit then every thirty-third digit after it, i.e. digit 1, digit 34, digit 67 etc, and stick them together."

Posted: Thu Aug 16, 2018 4:50 am
by th4wri
java :

Code: Select all

package hacker.org;

import java.math.BigInteger;

public class ThePowersThatBe {

	public static void main(String[] args) {

		
		BigInteger b = new BigInteger("17");
		b = b.pow(39);
		b = b.pow(11);
		String resOp = b.toString();
		String sol = "";
		for(int i=0;i<resOp.length();i=i+33)
			sol += resOp.charAt(i);
		System.out.println(sol);
		
		
	}

}


Posted: Wed Jan 06, 2021 12:09 pm
by Balian_von_Ibelin
solved it in haskell

x = show ((17^39)^11)
getX :: [Char] -> [Char]
getX "" = ""
getX y = head y : getX (drop 33 y)


getX x = solution


first time i can use it for something after i had to learn it while studying