This number is,
inter alia, a sum of 3 consecutive primes and can also be represented as a sum of 3 non-zero squares (not necessarily distinct) in 8 different ways.
Find the smallest number fitting the above description.
What else can be added re this number?
There are 9 ways of thus expressing the sum of
689 = 227 + 229 + 233, which are 3 consecutive primes.
Strictly speaking you can take any 8 of those 9 and say that you can make the sum in 8 different ways. All 9 ways are the sums of
676 9 4
576 64 49
529 144 16
484 196 9
484 169 36
400 225 64
361 324 4
324 196 169
289 256 144
(Sum the numbers on each line.)
689 does have the quality that it looks the same upside down.
However if you want such a number that can be formed in such a manner in exactly 8 ways, no more, no less, there's
701 = 229 + 233 + 239
which starts just one beyond the previous starting prime.
The lines that add up to 701 are:
676 16 9
576 121 4
576 100 25
441 256 4
441 196 64
361 324 16
361 196 144
324 256 121
Taken from the output of a program that shows those with four or more ways:
global ways sqs remain curr wayCt
found=false; p=0; q=2; r=3; n=5;
for i=1:1000
sqs(i)=i*i;
end
while n<900
n=n-p;
p=q; q=r; r=nextprime(r+1);
n=n+r;
if n==41
xx=2;
end
w=squareWays(n);
if w>=4
disp([n p q r w])
for i=1:w
disp(ways(i,:))
end
end
end
function w=squareWays(n)
global ways sqs remain curr wayCt sizecurr
wayCt=0;
ways=[];
sr=floor(sqrt(n));
remain=n; curr=[];
addOn(sr)
w=wayCt;
end
function addOn(den)
global curr remain sqs ways wayCt sizecurr
many=floor(remain/sqs(den));
if many>0
if many>3
many=3;
end
for i=many:-1:0 % allowing multiple occurrences of each square
remain=remain-i*sqs(den);
addition=[];
for j=1:i
addition=[addition sqs(den)];
end
currSave=curr;
curr=[curr addition];
if remain==0
if size(curr,2)==3
wayCt=wayCt+1;
ways=[ways; curr];
end
else
if den>1
if size(curr,2)<3 & remain>0
addOn(den-1)
end
end
end
remain=remain+i*sqs(den);
curr=currSave;
end
else
if den>1 & size(curr,2)<3 & remain>0
addOn(den-1)
end
end
end
showing
n ----primes--- ways (key applies only to each header)
251 79 83 89 4
225 25 1 (these rest are the squares)
169 81 1
121 121 9
121 81 49
269 83 89 97 5
256 9 4
196 64 9
169 64 36
144 121 4
144 100 25
329 107 109 113 6
324 4 1
289 36 4
256 64 9
225 100 4
169 144 16
144 121 64
371 113 127 131 4
361 9 1
289 81 1
225 121 25
169 121 81
395 127 131 137 4
361 25 9
289 81 25
225 169 1
225 121 49
425 137 139 149 6
400 16 9
324 100 1
289 100 36
256 144 25
225 196 4
225 100 100
581 191 193 197 7
576 4 1
529 36 16
484 81 16
400 100 81
324 256 1
289 256 36
256 225 100
589 193 197 199 4
576 9 4
441 144 4
324 256 9
324 144 121
633 199 211 223 6
625 4 4
529 100 4
484 100 49
400 169 64
361 256 16
256 256 121
661 211 223 227 4
576 81 4
576 49 36
400 225 36
324 256 81
689 227 229 233 9
676 9 4
576 64 49
529 144 16
484 196 9
484 169 36
400 225 64
361 324 4
324 196 169
289 256 144
701 229 233 239 8
676 16 9
576 121 4
576 100 25
441 256 4
441 196 64
361 324 16
361 196 144
324 256 121
713 233 239 241 6
676 36 1
576 121 16
484 225 4
441 256 16
400 169 144
324 289 100
731 239 241 251 7
729 1 1
625 81 25
529 121 81
441 289 1
441 169 121
361 361 9
361 289 81
749 241 251 257 8
729 16 4
676 64 9
576 169 4
484 256 9
484 144 121
400 324 25
361 324 64
324 256 169
771 251 257 263 4
625 121 25
529 121 121
361 361 49
361 289 121
789 257 263 269 8
784 4 1
676 64 49
625 100 64
529 256 4
529 196 64
484 289 16
484 256 49
400 289 100
803 263 269 271 6
729 49 25
625 169 9
529 225 49
441 361 1
361 361 81
289 289 225
817 269 271 277 4
576 225 16
529 144 144
484 324 9
324 324 169
829 271 277 281 5
784 36 9
729 64 36
676 144 9
441 324 64
361 324 144
857 281 283 293 8
784 64 9
729 64 64
676 100 81
625 196 36
576 256 25
529 324 4
484 324 49
441 400 16
|
Posted by Charlie
on 2020-12-13 13:42:11 |