← Complete problem index

PROJECT EULER · #0940

Two-Dimensional Recurrence

Statement only · SolvedOriginal problem ↗

The Fibonacci sequence (fi) is the unique sequence such that

  • f0=0
  • f1=1
  • fi+1=fi+fi1

Similarly, there is a unique function A(m,n) such that

  • A(0,0)=0
  • A(0,1)=1
  • A(m+1,n)=A(m,n+1)+A(m,n)
  • A(m+1,n+1)=2A(m+1,n)+A(m,n)

Define S(k)=i=2kj=2kA(fi,fj). For example S(3)=A(1,1)+A(1,2)+A(2,1)+A(2,2)=2+5+7+16=30You are also given S(5)=10396.

Find S(50), giving your answer modulo 1123581313.

Write-up coming later

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