mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2015-02-23, 00:49   #23
Jayder
 
Jayder's Avatar
 
Dec 2012

2×139 Posts
Default

If that's only running on one core, mine is abysmally slow in comparison to yours. If it's different from what Kevin posted, would you mind sharing the code? I might learn something.
Jayder is offline   Reply With Quote
Old 2015-02-23, 01:18   #24
davar55
 
davar55's Avatar
 
May 2004
New York City

2·29·73 Posts
Default

You might want to check out OEIS sequence A135738.
davar55 is offline   Reply With Quote
Old 2015-02-23, 07:15   #25
Jayder
 
Jayder's Avatar
 
Dec 2012

2·139 Posts
Default

m_f_h's code is better written than mine, but it's slower in its unoptimised state.

I see that the OEIS entry still asks why a(2n+1)=a(2n). I was able to figure out why, but as this is the Puzzles subforum I won't share the answer, particularly because it's not hard to figure out. It also answers why, after base 2, it is always an even number.
Jayder is offline   Reply With Quote
Old 2015-02-24, 00:30   #26
legendarymudkip
 
legendarymudkip's Avatar
 
Jun 2014

23·3·5 Posts
Default

The code I used for the benchmarking is at http://pastebin.com/pjUAD0Ys . It can definitely be improved upon, but I don't know enough about optimization of C++ for this - I don't know what language you were using but it's just about possible that's some of why it was faster. Another possibility is hardware, as although it was run on 1 core, it was 1 core of an i5-4670k.
legendarymudkip is offline   Reply With Quote
Old 2015-02-25, 16:04   #27
davar55
 
davar55's Avatar
 
May 2004
New York City

2·29·73 Posts
Default

Quote:
Originally Posted by Jayder View Post
...
I see that the OEIS entry still asks why a(2n+1)=a(2n). I was able to figure out why, but as this is the Puzzles subforum I won't share the answer, particularly because it's not hard to figure out. It also answers why, after base 2, it is always an even number.
Why not post it here? The oeis entry points here anyway.
davar55 is offline   Reply With Quote
Old 2015-02-26, 06:50   #28
Jayder
 
Jayder's Avatar
 
Dec 2012

2×139 Posts
Default

Quote:
Originally Posted by davar55 View Post
Why not post it here? The oeis entry points here anyway.
I'm sorry if I'm being annoying. I had fun figuring it out, and I don't want to deprive you (or anyone else) of that joy. It's an easier problem than you might think. Let me transform the problem for you, which will give you the same hint that I had:

Let's take this list and change it to tell us the highest base in the unbroken chain.

Code:
n		highest base

6		3
10		5
54		9
130		13
390		15
2000		17
3238		19
4080		21
7326		23
16584		25
17310		33
231000		37
466352		41
Do you see anything in common with the numbers in each column? It's very simple. If nobody beats me to it I'll post the answer when I get bored.
Jayder is offline   Reply With Quote
Old 2015-02-26, 08:58   #29
axn
 
axn's Avatar
 
Jun 2003

22×3×421 Posts
Default

digitsum(n,b) == n (mod (b-1)) [which is the basis for "divisibility by 9" shortcut]

For odd b, 2 | (b-1). Rest follows.
axn is online now   Reply With Quote
Old 2015-03-17, 00:53   #30
Jayder
 
Jayder's Avatar
 
Dec 2012

2×139 Posts
Default

For those that didn't understand, axn just explained that, given an even n and an odd b, you will always have an even digit sum. This is roughly how I figured it out:

Let's give '1234' in ternary: 1200201. How can you convert it back into decimal? Forgive my inexact wording here: You find the value of each digit and add them together. For example, since it's ternary, the rightmost digit's value is 1*3^0. The full sum is 1*3^6 + 2*3^5 + 0*3^4 + 0*3^3 + 2*3^2 + 0*3^1 + 1*3^0 = 123410.

We know that an odd number multiplied by another odd number is going to give an odd result, and that an even number added to an odd number gives an odd number. I'm going to skip a bit here, but in order for our sum above to result in an even number (1234), we needed to have an even number of odd digits in our converted base. An even number of odd digits, as might be obvious, is required to have an even sum of digits. So: Even though our example used ternary, an even number in any odd base will have an even amount of odd digits. Therefore, there is no point in testing odd bases, as they will always "pass".

Now I wait for somebody to tell me how crap my explanation was.
Jayder is offline   Reply With Quote
Old 2015-03-17, 03:06   #31
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

7×1,373 Posts
Default

Quote:
Originally Posted by Jayder View Post
Let's give '1234'
Hey, how do you know my password?
LaurV is offline   Reply With Quote
Old 2015-03-30, 03:11   #32
axn
 
axn's Avatar
 
Jun 2003

22·3·421 Posts
Default

As continuation from the last OEIS entry, here are the successive records.
Code:
base = 46 @ n = 3020830
base = 50 @ n = 13655684
base = 60 @ n = 247783834
base = 68 @ n = 15414298020
base = 76 @ n = 43427482624
base = 78 @ n = 731006573462
base = 80 @ n = 1251455242678
base = 82 @ n = 12729637799668
base = 88 @ n = 19807076334958
base = 94 @ n = 180942524431476
base = 98 @ n = 188893618365750
base = 102 @ n = 632712065014988
axn is online now   Reply With Quote
Old 2015-04-01, 00:11   #33
Jayder
 
Jayder's Avatar
 
Dec 2012

2·139 Posts
Default

Whoa, how did you do that?
Jayder is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How many digits? kokakola Information & Answers 23 2009-11-03 05:08
15M Digits - Just For Fun storm5510 Math 7 2009-09-08 04:14
All 10 Digits davar55 Puzzles 5 2007-06-18 15:06
140+ digits which is better marthamm GMP-ECM 4 2006-01-25 17:32
Exponential Digits ndpowell Math 18 2005-07-15 22:31

All times are UTC. The time now is 03:35.


Sat Jul 17 03:35:17 UTC 2021 up 50 days, 1:22, 1 user, load averages: 1.56, 1.88, 1.68

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.