• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:33
CEST 18:33
KST 01:33
  • 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 Preview5[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 (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris39Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195
StarCraft 2
General
2024/25 Off-Season Roster Moves #2: Serral - Greatest Players of All Time #1: Maru - Greatest Players of All Time Maestros of the Game: Week 1/Play-in Preview Greatest Players of All Time: 2025 Update
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris LiuLi Cup - September 2025 Tournaments $5,100+ SEL Season 2 Championship (SC: Evo) Kirktown Chat Brawl #8 - 4.6K max Tonight LiuLi Cup - August 2025 Tournaments
Strategy
Custom Maps
External Content
Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Post ASL20 Ro24 discussion. Easiest luckies way to get out of Asl groups BW General Discussion No Rain in ASL20?
Tourneys
[ASL20] Ro24 Group F [IPSL] CSLAN Review and CSLPRO Reimagined! Small VOD Thread 2.0 Cosmonarchy Pro Showmatches
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
General RTS Discussion Thread Warcraft III: The Frozen Throne Path of Exile Mechabellum Nintendo Switch Thread
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 Russo-Ukrainian War Thread YouTube Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2026 Football Thread 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
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: 699 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
Maestros of the Game
16:00
Round of 24 Preliminary Stage
SHIN vs CreatorLIVE!
Astrea vs Lambo
Bunny vs SKillous
HeRoMaRinE vs TriGGeR
ComeBackTV 1021
CranKy Ducklings184
CosmosSc2 41
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 410
mouzHeroMarine 370
IndyStarCraft 257
CosmosSc2 41
JuggernautJason10
StarCraft: Brood War
Britney 33876
Bisu 1166
Mini 992
Jaedong 837
firebathero 651
sSak 457
ggaemo 238
Barracks 147
hero 79
Mong 75
[ Show more ]
Hyun 59
Mind 57
Aegong 54
ToSsGirL 37
soO 33
zelot 24
yabsab 23
IntoTheRainbow 9
SilentControl 8
Stormgate
BeoMulf56
Dota 2
Gorgc6771
qojqva3093
Dendi1255
XcaliburYe316
Fuzer 298
Counter-Strike
fl0m4591
ScreaM1649
gobbtv582
Heroes of the Storm
Liquid`Hasu551
Other Games
gofns1962
FrodaN939
Hui .409
KnowMe183
MindelVK4
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• EnkiAlexander 86
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Pr0nogo 25
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Counter-Strike
• Shiphtur96
Other Games
• WagamamaTV252
Upcoming Events
BSL Team Wars
2h 27m
Team Bonyth vs Team Sziky
BSL Team Wars
2h 27m
Team Dewalt vs Team Sziky
Afreeca Starleague
17h 27m
Soulkey vs BeSt
Snow vs Light
Monday Night Weeklies
23h 27m
Replay Cast
1d 7h
Sparkling Tuna Cup
1d 17h
PiGosaur Monday
2 days
LiuLi Cup
2 days
Replay Cast
3 days
The PondCast
3 days
[ Show More ]
RSL Revival
3 days
Maru vs SHIN
MaNa vs MaxPax
RSL Revival
4 days
Reynor vs Astrea
Classic vs sOs
BSL Team Wars
5 days
Team Bonyth vs Team Dewalt
CranKy Ducklings
5 days
RSL Revival
5 days
GuMiho vs Cham
ByuN vs TriGGeR
Cosmonarchy
5 days
TriGGeR vs YoungYakov
YoungYakov vs HonMonO
HonMonO vs TriGGeR
[BSL 2025] Weekly
6 days
RSL Revival
6 days
Cure vs Bunny
Creator vs Zoun
Liquipedia Results

Completed

Acropolis #4 - TS1
WardiTV Summer 2025
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 2
Maestros of the Game
SEL Season 2 Championship
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

CSL 2025 AUTUMN (S18)
LASL Season 20
2025 Chongqing Offline CUP
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #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.