Google's problem solver 

Google posted this a week ago on a street banner:

{ First 10 digit prime in consecutive digits of e }.com

If you take e's digits you get something like this:

71828182845904523536028747135266249775724709369995
95749669676277240766303535475945713821785251664274
27466391
932003059921817413596629043572900334295260
59563073813232862794349076323382988075319525101901
15738341879307021540891499348841675092447614606680
82264800168477411853742345442437107539077744992069
55170276183860626133138458300075204493382656029760
67371132007093287091274437470472306969772093101416
92836819025515108657463772111252389784425056953696
77078544996996794686445490598793163688923009879312
77361782154249992295763514822082698951936680331825
288693984964651058209392398294887933203625094431...

One has to find the first sequence in e's digits which is also a prime.

The solution to this is: http://7427466391.com

There you have a web page stating this:

f(1)= 7182818284
f(2)= 8182845904
f(3)= 8747135266
f(4)= 7427466391
f(5)= __________

Question is how to find f(5), which is also the password for http://www.linux.org?

If you look at the numbers for long enough you will find that they all sum up to 49. The second observation is that the numbers all belong to e's digits. Third observation is, that numbers are 10 digits long.

So the task is to find a fifth 10-digit sequence in e's digits with the sum of 49.

This solves it using brute force:

using System;

public class GoogleSolver
{
 public static void Main()
 {
  string strE = "71828182845904523536028747135266249775";
  strE+= "724709369995957496696762772407663035354759457";
  strE+= "138217852516642742746639193200305992181741359";
  strE+= "662904357290033429526059563073813232862794349";
  strE+= "076323382988075319525101901157383418793070215";
  strE+= "408914993488416750924476146066808226480016847";
  strE+= "741185374234544243710753907774499206955170276";
  strE+= "183860626133138458300075204493382656029760673";
  strE+= "711320070932870912744374704723069697720931014";
  strE+= "169283681902551510865746377211125238978442505";
  strE+= "695369677078544996996794686445490598793163688";
  strE+= "923009879312773617821542499922957635148220826";
  strE+= "989519366803318252886939849646510582093923982";
  strE+= "94887933203625094431";

  for (int intI = 0; intI < strE.Length - 10; intI++)
  {
   if (sumString(strE.Substring(intI, 10)) == 49)
    Console.WriteLine(strE.Substring(intI, 10));
  }
  Console.ReadLine();
 }

 public static int sumString(string strSumThis)
 {
  int intSum = 0;
  for (int intI = 0; intI < strSumThis.Length; intI++)
  {
   intSum = intSum + Convert.ToInt32(strSumThis.Substring(intI, 1));
  }
  return intSum;
 }
}

Go to http://www.linux.org and apply for Google Labs.

Categories:  Other
Thursday, 15 July 2004 22:00:59 (Central Europe Standard Time, UTC+01:00)  #    Comments

 

 Mono 1.0 Released 

The day has finally come.

Mono 1.0 has been released. Site structure and design have also been updated.

Get it here.

Categories:  Mono
Thursday, 01 July 2004 08:15:46 (Central Europe Standard Time, UTC+01:00)  #    Comments

 

Copyright © 2003-2024 , Matevž Gačnik
Recent Posts
RD / MVP
Feeds
RSS: Atom:
Archives
Categories
Blogroll
Legal

The opinions expressed herein are my own personal opinions and do not represent my company's view in any way.

My views often change.

This blog is just a collection of bytes.

Copyright © 2003-2024
Matevž Gačnik

Send mail to the author(s) E-mail