All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Permuted Duodecimal Mean Muse (Posted on 2022-12-19) Difficulty: 3 of 5
The following sum is constituted for each permutation p1, p2, p3,..., p9, pA, pB, p10 of the duodecimal (base 12) integers 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, 10:

|p1-p2|+|p3-p4|+|p5-p6|+|p7-p8|+|p9-pA|+|pB-p10|

Determine the average value of all such sums.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution | Comment 1 of 5
Summary:  For n=12, I got 26, though my program took an hour to run.
Re-evaluating this at various numbers other than 12 leads to what appears to be the n-th triangular number divided by 3

n avg
2  1
4  10/3
6  7
8  12
10 55/3
12 26

--------
n=12

p = [i for i in range(1,n+1)]
from itertools import permutations
grandsum = 0
count = 0
for perm in permutations(p):
    count += 1
    s = 0
    for i in range(1,n,2):
        s += abs(perm[i-1] - perm[i])
    grandsum += s

print(n,grandsum/count)

  Posted by Larry on 2022-12-19 07:03:49
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (5)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (11)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information