• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 05:11
CEST 11:11
KST 18:11
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Maestros of the Game: Week 1/Play-in Preview9[ASL20] Ro24 Preview Pt2: Take-Off7[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9
Community News
Weekly Cups (August 25-31): Clem's Last Straw?26Weekly Cups (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris46Weekly Cups (Aug 11-17): MaxPax triples again!15Weekly Cups (Aug 4-10): MaxPax wins a triple6
StarCraft 2
General
Speculation of future Wardii series Weekly Cups (August 25-31): Clem's Last Straw? Geoff 'iNcontroL' Robinson has passed away #1: Maru - Greatest Players of All Time Maestros of the Game: Week 1/Play-in Preview
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Maestros of The Game—$20k event w/ live finals in Paris Monday Nights Weeklies LiuLi Cup - September 2025 Tournaments 🏆 GTL Season 2 – StarCraft II Team League
Strategy
Custom Maps
External Content
Mutation # 489 Bannable Offense Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies
Brood War
General
ASL20 General Discussion BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Starcraft at lower levels TvP Victoria gamers
Tourneys
[Megathread] Daily Proleagues Is there English video for group selection for ASL [ASL20] Ro24 Group F [IPSL] CSLAN Review and CSLPRO Reimagined!
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread Warcraft III: The Frozen Throne Nintendo Switch Thread Mechabellum Teeworlds - online game
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread YouTube Thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s) Gtx660 graphics card replacement
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
How Culture and Conflict Imp…
TrAiDoS
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
INDEPENDIENTE LA CTM
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 728 users

[SC2B Key Contest]Math challenge

Blogs > yh8c4
Post a Reply
1 2 3 Next All
yh8c4
Profile Blog Joined July 2009
108 Posts
Last Edited: 2010-05-02 01:01:04
May 01 2010 22:18 GMT
#1
contest is over, winner is hamster1800

Original problem was taken from here: http://projecteuler.net/index.php?section=problems&id=290

Solution:

+ Show Spoiler +


ok, the key is yours:

xxxxxx-xxxx-xxxxxx-xxxx-xxxxxx

have fun

-----------------------------------------
Original Message:
Sure thing
9090754242258600
1710153888867000

-----------------------------------------
Original Message:
could you give me 2 examples for x for which ds(x) = ds(x * 137)?

-----------------------------------------
Original Message:
Answer =
20444710234716473

Solution is a dynamic programming algorithm. State is based on the last k digits of the number, lazily computing the digit sum of 137*x digit by digit, storing the next 4 digits to the left of the last k digits (using the fact that 9*137 + 99 < 10000). I iterate through the values of k from 0 to 17, increasing it by one each time (so that at the end we have the values for 18), computing the number of numbers x for which the next 4 digits to the left are "a" and the difference between ds(x) and ds(137*x) (up to the last k digits) is "b".

Code below:

#include<cstdio>
#include<cstdlib>

using namespace std;

int main() {
long long **now, **next;
now = new long long*[10000];
next = new long long*[10000];
for(int i = 0; i<10000; i++) {
now[i] = new long long[401];
next[i] = new long long[401];
now[i] += 200;
next[i] += 200;
for(int j = -200; j<=200; j++) {
now[i][j] = next[i][j] = 0;
}
}
now[0][0] = 1;
for(int i = 0; i<18; i++) {
for(int j = 0; j<10000; j++) {
for(int k = -200; k<=200; k++) {
next[j][k] = 0;
}
}
for(int a = 0; a<10000; a++) {
for(int b = -162; b<=162; b++) {
for(int d = 0; d<=9; d++) {
int na = a/10 + 137*d, nb = b - a%10 + d;
next[na][nb] += now[a][b];
}
}
}
long long **t = now;
now = next;
next = t;
}
long long ans = 0;
for(int i = 0; i<10000; i++) {
for(int j = -200; j<=200; j++) {
int a = i, b = j;
while(a != 0) {
b -= a%10;
a/=10;
}
if(b == 0) {
ans += now[i][j];
}
}
}
printf("%lld\n",ans);
}




----------------------


I dont know whether there is still a high demand for beta keys, but I received another friend invite key, which you can win by solving the following challenge:

Let x be an integer equal to or greater than 0 and smaller than 1000000000000000000 (10^18).

Let ds(x) be the digit sum of x, i.e. ds(123) = 1 + 2 + 3 = 6

For how many distinct x is ds(x) = ds(137 * x)?

The first one to pm me a) the correct answer and b) a little explanation (e.g. source code) how to find the solution will receive a beta key.

Once I receive a solution, I'll reply whether it's correct or not. If it's not correct you can try again.

Good luck!

edit 1: The solution is NOT 1!
edit 2: ds(solution) = 59


zealing
Profile Blog Joined January 2009
Canada806 Posts
May 01 2010 22:21 GMT
#2
can't you just give me the key? i skiped school to play BW so i don't know math, could i just beat you 1v1 Destination BW for the key? its all i got
Think you got lag? It took Jesus 3 days to respawn.
yh8c4
Profile Blog Joined July 2009
108 Posts
May 01 2010 22:25 GMT
#3
On May 02 2010 07:21 zealing wrote:
can't you just give me the key? i skiped school to play BW so i don't know math, could i just beat you 1v1 Destination BW for the key? its all i got


unfortunately, beating me in bw is anything but a challenge and thus I can't reward you with a beta key for that
Sadistx
Profile Blog Joined February 2009
Zimbabwe5568 Posts
May 01 2010 22:27 GMT
#4
Bah, I wish a java SDE lying around, i could tell you in less than a minute :/

This is so easy if you have any programming thing lying around.
Lightwip
Profile Blog Joined April 2010
United States5497 Posts
May 01 2010 22:28 GMT
#5
I might try to write a program to do this.
If you are not Bisu, chances are I hate you.
Shrine
Profile Blog Joined April 2010
Australia107 Posts
May 01 2010 22:37 GMT
#6
11
Hell is empty, All the devils are here.
yh8c4
Profile Blog Joined July 2009
108 Posts
May 01 2010 22:37 GMT
#7
yes, writing a program is a good idea, but be aware that 10^18 is really big
Lightwip
Profile Blog Joined April 2010
United States5497 Posts
May 01 2010 22:48 GMT
#8
Yeah, I'm not sure that would even fit in a long int.
If you are not Bisu, chances are I hate you.
Sharkified
Profile Joined January 2009
Canada254 Posts
May 01 2010 22:52 GMT
#9
On May 02 2010 07:27 Sadistx wrote:
Bah, I wish a java SDE lying around, i could tell you in less than a minute :/

This is so easy if you have any programming thing lying around.


Nah it takes forever to do it, would have to find a complicated way of doing it, then rather just learn maths.
yh8c4
Profile Blog Joined July 2009
108 Posts
May 01 2010 22:56 GMT
#10
On May 02 2010 07:37 Shrine wrote:
11


wrong
JonnyWhy
Profile Blog Joined May 2010
Canada94 Posts
May 01 2010 22:57 GMT
#11
43?
Say something juicy.
Sharkified
Profile Joined January 2009
Canada254 Posts
May 01 2010 23:00 GMT
#12
Is it a one try thing ?
JonnyWhy
Profile Blog Joined May 2010
Canada94 Posts
May 01 2010 23:03 GMT
#13
On May 02 2010 08:00 Sharkified wrote:
Is it a one try thing ?


On May 02 2010 07:18 yh8c4 wrote:
Once I receive a solution, I'll reply whether it's correct or not. If it's not correct you can try again.


Say something juicy.
yh8c4
Profile Blog Joined July 2009
108 Posts
May 01 2010 23:04 GMT
#14
no, this is not limited to 1 try, but stop just posting or pming a single number. to receive the key you must have the correct answer AND an explanation why your answer is correct.
yh8c4
Profile Blog Joined July 2009
108 Posts
Last Edited: 2010-05-01 23:12:07
May 01 2010 23:06 GMT
#15
here's a little hint:

let cs be the correct solution. ds(cs) = 59.
Synthesis
Profile Joined August 2008
Canada167 Posts
May 01 2010 23:08 GMT
#16
42.

Source
Sadistx
Profile Blog Joined February 2009
Zimbabwe5568 Posts
May 01 2010 23:09 GMT
#17
On May 02 2010 08:08 Synthesis wrote:
42.

Source


That joke got old the first 1000 times people used it.
Nehsb
Profile Joined May 2009
United States380 Posts
May 01 2010 23:09 GMT
#18
Hmmm, 137 | 10001, 99999999, and 10^12 + 1.

Might be useful?

Might be able to use that to cut down the numbers you have to search...
TwilightStar
Profile Blog Joined August 2009
United States649 Posts
May 01 2010 23:19 GMT
#19
3.76
(5)Twilight Star.scx --------- AdmiralHoth: There was one week when I didn't shave for a month.
Sadistx
Profile Blog Joined February 2009
Zimbabwe5568 Posts
May 01 2010 23:24 GMT
#20
From what I understand, it will be a pretty big number, around 29000000000000000.

I have no means of actually solving this without getting a programming language that handles huge numbers and writing code for it.

I'm sure one of the math majors on here has a better way than brute forcing it.
1 2 3 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 1h 49m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech79
StarCraft: Brood War
Calm 10448
actioN 332
ggaemo 219
Soma 140
PianO 120
ZerO 104
Leta 91
Sharp 83
Pusan 78
sSak 54
[ Show more ]
soO 42
Aegong 32
Sexy 25
Sacsri 16
HiyA 12
yabsab 11
Bale 9
Movie 8
Dota 2
BananaSlamJamma186
XcaliburYe143
Counter-Strike
olofmeister1026
shoxiejesuss658
Other Games
summit1g6024
ceh9511
Tasteless349
Happy180
OGKoka 99
ZerO(Twitch)14
Organizations
Other Games
gamesdonequick636
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• LUISG 28
• iHatsuTV 6
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos498
• HappyZerGling72
Upcoming Events
LiuLi Cup
1h 49m
Replay Cast
14h 49m
The PondCast
1d
RSL Revival
1d
Maru vs SHIN
MaNa vs MaxPax
Maestros of the Game
1d 7h
Classic vs TriGGeR
Reynor vs SHIN
OSC
1d 17h
MaNa vs SHIN
SKillous vs ShoWTimE
Bunny vs TBD
Cham vs TBD
RSL Revival
2 days
Reynor vs Astrea
Classic vs sOs
Maestros of the Game
2 days
Serral vs Ryung
ByuN vs Zoun
BSL Team Wars
2 days
Team Bonyth vs Team Dewalt
CranKy Ducklings
3 days
[ Show More ]
RSL Revival
3 days
GuMiho vs Cham
ByuN vs TriGGeR
Cosmonarchy
3 days
TriGGeR vs YoungYakov
YoungYakov vs HonMonO
HonMonO vs TriGGeR
Maestros of the Game
3 days
Solar vs Bunny
Clem vs Rogue
[BSL 2025] Weekly
3 days
RSL Revival
4 days
Cure vs Bunny
Creator vs Zoun
Maestros of the Game
4 days
Maru vs Lambo
herO vs ShoWTimE
BSL Team Wars
4 days
Team Hawk vs Team Sziky
Sparkling Tuna Cup
5 days
Liquipedia Results

Completed

CSL Season 18: Qualifier 2
SEL Season 2 Championship
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL 2025 AUTUMN (S18)
Maestros of the Game
Sisters' Call Cup
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

LASL Season 20
2025 Chongqing Offline CUP
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
EC S1
BLAST Rivals Fall 2025
Skyesports Masters 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.