Question: Prime Triangle In this problem, you are given a simple task. Denote pi as the first digit of the i-th prime. You need to output

Prime Triangle

In this problem, you are given a simple task. Denote pi as the first digit of the i-th prime. You need to output a prime triangle with the size of N. A prime triangle with the size N can be constructed as follows:

the first line contains the first digit of the first prime, which is p1

the second line contains the first digit of the next two primes, which are p2 and p3

the third line contains the first digit of the next three primes, which are p4, p5, and p6

. . .

the N-th line contains the first digit of the next N primes, which are

Prime Triangle In this problem, you are given a simple task. Denote

Format Input

The first line consists of an integer T which represents the number of testcases. For each testcase, there is a line containing an integer N, which represent the size of the prime triangle.

Format Output For each testcase, output Case #X: where X indicates the testcase number started from 1. Then, it is followed in the next line with the asked prime triangle.

Constraints

1 T 100

1 N 100

Sample Input 1 (standard input)

2

4

1

Sample Output 1 (standard output)

Case #1:

2

35

713

7939

Case #2:

2

N(N+1) N(N +1) N(N +1) p - N +1,p- - N +2, ...,P 2 2 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!