# [SOLUTION] Is it Series solution codechef 2021 – Spider AlgoCup Codechef

## Is it Series solution codechef 2021

Chef define a function F(n)F(n), where he can write F(n)F(n) in the form of sum of Pi/QiPi/Qi for each integer ii (i1i≥1), we can define PiPi as the number of ways to fill nn positions with ii options at each position and Qi is number of ways to fill ii positions with 22 options at each position.

Formally, Pi=inPi=inQi=2iQi=2iF(n)F(n) = ΣPi/QiΣPi/Qi ( i1i≥1)

As the F(n)F(n) can be large, the chef asked you to solve and output F(n)F(n) modulo 109+7109+7.

### Input: Is it Series solution codechef 2021

• First line will contain TT, number of testcases. Then the testcases follow.
• Each testcase contains a single line of input, one integers nn.

### Output: Is it Series solution codechef 2021

For each testcase, output in a single line F(n)F(n) modulo 1000000007.

### Constraints Is it Series solution codechef 2021

• 1T1051≤T≤105
• 1n60001≤n≤6000

3
1
2
3

2
6
26

### EXPLANATION:

First Test case has n=1n=1,Pi=i1Pi=i1Qi=2iQi=2iF(1)=Σi1/2iF(1)=Σi1/2i and i1i≥1 = 2.