← Complete problem index

PROJECT EULER · #0968

5D Summation

Statement only · SolvedOriginal problem ↗

Define P(Xa,b,Xa,c,Xa,d,Xa,e,Xb,c,Xb,d,Xb,e,Xc,d,Xc,e,Xd,e) as the sum of 2a3b5c7d11e over all quintuples of non-negative integers (a,b,c,d,e) such that the sum of each two of the five variables is restricted by a given value. In other words, a+bXa,b, a+dXa,d, b+eXb,e etc.

For example, P(2,2,2,2,2,2,2,2,2,2)=7120 and P(1,2,3,4,5,6,7,8,9,10)799809376(mod109+7).

Define a sequence A as follows:

  • A0=1, A1=7;
  • An=(7An1+An22)mod(109+7) for n2.

Also define Q(n)=P(A10n,A10n+1,A10n+2,,A10n+9).

Find 0n<100Q(n). Give your answer modulo 109+7.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.