Final answer, four solutions:
10,12,14,16,85,87,89 sum= 313
80,82,84,86,15,17,19 sum= 383
56,57,58,59,40,41,42 sum= 353
46,47,48,49,50,51,52 sum= 343
though this last one is one long sequence so, depending on the definition of "two sequences" it may or may not qualify
-------
Parity analysis:
N T I
e e e I odd reject
e e o I even reject
e o e I even
e o o I odd
o e e I even
o e o I odd
o o e I odd reject
o o o I even reject
So one of {N,T} is odd and one is even
For 7 2-digit numbers to add to a 3-digit number, I < 7.
From the known constraints, a program search finds the possible values of N,T,I as:
[1, 8, 3], [2, 7, 3], [4, 5, 3], [5, 4, 3], [7, 2, 3], [8, 1, 3]
We know from the program that N+T = 9 and I=3; sum(N,T,I) = 12;
sum(CLOUDSA) must be 33, since sum(all digits) = 45. Also: N and T are both nonzero.
But wait; there is also the two arithmetic sequences. I assume there must be a minimum of three numbers to make such a sequence, so the two choices for sequences are:
case 1: (NC,NL,NO,NU) then (TD,TS,TA) or
case 2: (NC,NL,NO) then (NU,TD,TS,TA)
case 1:
The only possibilities for C,L,O,U are
(C,L,O,U) sum(D,S,A)
(0,2,4,6), D+S+A=21 remaining digits: 1,5,7,8,9
{N,T} = {1,8}; (D,S,A)= (5,7,9)
10,12,14,16,85,87,89 sum= 313 SUCCESS
80,82,84,86,15,17,19 sum= 383 SUCCESS
(2,4,6,8), D+S+A=13 remaining digits: 0,1,5,7,9 REJECT
no way to pick N,T that sum to 9
(4,5,6,7), D+S+A=11 remaining digits: 0,1,2,8,9 REJECT
{N,T} = {1,8} but 0,2,9 not arithmetic sequence
(5,6,7,8), D+S+A=7 remaining digits: 0,1,2,4,9 REJECT
no way to pick N,T that sum to 9
(6,7,8,9), D+S+A=3 remaining digits: 0,1,2,4,5
{N,T} = {4,5}; (D,S,A)= (0,1,2)
46,47,48,49,50,51,52 sum= 343 SUCCESS
56,57,58,59,40,41,42 sum= 353 SUCCESS
case 2:
In this case, I=3, N=4, T=N+1=5. Immediately 0,1,2 and 6,7,8,9 come to mind, except recall that NU is followed by TD we can get a similar result of : (C,L,O)=(6,7,8) and (U,D,S,A)=(9,0,1,2)
46,47,48,49,50,51,52 sum= 343 SUCCESS
In fact, given that 3,4,5 are already taken, there are no other possible values for (U,D,S,A)
-----------------
solutions = []
for N in range(1,10):
for T in range(1,10):
if N%2 == 0 and T in [2,4,6,8,N]:
continue
if N%2 == 1 and T in [1,3,5,7,9,N]:
continue
for C in range(10):
if C in [N,T]:
continue
for L in range(10):
if L in [N,T,C]:
continue
for O in range(10):
if O in [N,T,C,L]:
continue
for U in range(10):
if U in [N,T,C,L,O]:
continue
for D in range(10):
if D in [N,T,C,L,O,U]:
continue
for S in range(10):
if S in [N,T,C,L,O,U,D]:
continue
for A in range(10):
if A in [N,T,C,L,O,U,D,S]:
continue
for I in range(1,10):
if I in [N,T,C,L,O,U,D,S,A]:
continue
if 40*N + 30*T +C+L+O+U+D+S+A == 101*I + 10*N:
if [N,T,I] not in solutions:
solutions.append([N,T,I])
print(solutions)
|
Posted by Larry
on 2024-01-16 12:39:10 |