Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help me figure out this algorithm

  1. Nov 3, 2008 #1
    I read the rules of the site and read the stickies, I hope this is in the right section.

    I need help figuring out this algorithm, putting a number in generates the corresponding numbers. Sorry if the post is long, I tried to get as much information as possible.

    I can enter any number that you want to try and figure it out.

    Thanks for any help in advance.


    Number that is put in.

    6547

    Numbers that are generated:


    19085
    19068
    19090
    19075
    19074
    19073
    19072
    19078
    19077
    19076
    19083
    19082
    19081
    19087
    19079
    19080
    20351
    20345
    20344
    20349
    20348
    20355
    20354
    20353
    20352
    20359
    20361
    20362
    20360
    20356
    20363
    20367
    20366
    20365
    20364
    20371
    20370
    20369
    20368
    20375
    20374
    20373
    20379
    20378
    20377
    20383
    20381
    20380
    20357
    20382
    20346
    20372
    20350
    20358
    20376
    19524
    19534
    19529
    19528
    19533
    19532
    19538
    19537
    19536
    19543
    19541
    19553
    19535
    19544
    19549
    19520
    19522
    19551
    19546
    19526
    19531
    19530
    19542
    19555
    19554
    19545
    19552
    19539
    19550
    19540
    19557
    19556
    19527
    19525
    19558
    19548
    19521
    19547
    20456
    20462
    20460
    20461
    20476
    20459
    20463
    20465
    20457
    20464
    20453
    20467
    20469
    20468
    20475
    20466
    20471
    20451
    20458
    20470
    20450
    20472
    20479
    20473
    20445
    20474
    20455
    20449
    20452
    20478
    20477
    20454
    19457
    19456
    20446
    19458
    20444
    20448


    Number that is put in.

    1138

    Numbers that are generated:

    22380
    22429
    22387
    22370
    22371
    22368
    22369
    22375
    22372
    22373
    22378
    22379
    22376
    22382
    22374
    22377
    21150
    21144
    21145
    21148
    21149
    21090
    21091
    21088
    21089
    21094
    21096
    21099
    21097
    21093
    21098
    21102
    21103
    21100
    21101
    21106
    21107
    21104
    21105
    21110
    21111
    21108
    21114
    21115
    21112
    21118
    21116
    21117
    21092
    21119
    21147
    21109
    21151
    21095
    21113
    20901
    20911
    20904
    20905
    20908
    20909
    20915
    20912
    20913
    20918
    20916
    20864
    20910
    20921
    20924
    20897
    20899
    20926
    20923
    20903
    20906
    20907
    20919
    20866
    20867
    20920
    20865
    20914
    20927
    20917
    20868
    20869
    20902
    20900
    20871
    20925
    20896
    20922
    21001
    21007
    21005
    21004
    21021
    21002
    21006
    21008
    21000
    21009
    20996
    21010
    21012
    21013
    21018
    21011
    21014
    20994
    21003
    21015
    20995
    21017
    21022
    21016
    21052
    21019
    20998
    20992
    20997
    21023
    21020
    20999
    20960
    20961
    21055
    20963
    21053
    20993
     
  2. jcsd
  3. Nov 3, 2008 #2
    See if the attached C program reproduces the same output. (Rename the .txt to an extension of .c , and compile on your own - I don't have a Windows machine at hand right now.)

    As a check, verify if the output, when given the number 1234, is:
    22476
    22333
    22483
    22466
    22467
    22464
    22465
    22471
    22468
    22469
    22474
    22475
    22472
    22478
    22470
    22473
    21054
    21048
    21049
    21052
    21053
    21186
    21187
    21184
    21185
    21190
    21192
    21195
    21193
    21189
    21194
    21198
    21199
    21196
    21197
    21202
    21203
    21200
    21201
    21206
    21207
    21204
    21210
    21211
    21208
    21214
    21212
    21213
    21188
    21215
    21051
    21205
    21055
    21191
    21209
    20741
    20751
    20744
    20745
    20748
    20749
    20755
    20752
    20753
    20758
    20756
    20768
    20750
    20761
    20764
    20737
    20739
    20766
    20763
    20743
    20746
    20747
    20759
    20770
    20771
    20760
    20769
    20754
    20767
    20757
    20772
    20773
    20742
    20740
    20775
    20765
    20736
    20762
    21161
    21167
    21165
    21164
    21181
    21162
    21166
    21168
    21160
    21169
    21156
    21170
    21172
    21173
    21178
    21171
    21174
    21154
    21163
    21175
    21155
    21177
    21182
    21176
    21148
    21179
    21158
    21152
    21157
    21183
    21180
    21159
    20800
    20801
    21151
    20803
    21149
    21153
     

    Attached Files:

  4. Nov 3, 2008 #3
    Algorithm has been found by one of my friends, thread can be locked or left to die.
     
    Last edited: Nov 4, 2008
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?