## CodeChef: May Long Challenge | An Interesting Sequence | ISS | Solution

View on Codechef Zanka finds fun in everyday simple things. One fine day he got interested in a very trivial sequence. Given a natural number kk, he considers the sequence Ai=k+i2Ai=k+i2 so that the terms arek+1,k+4,k+9,k+16,…k+1,k+4,k+9,k+16,… Now to make things more interesting, he considers the gcdgcd of consecutive terms in the sequence, then takes the sum of the first 2k2k values. More …

CodeChef: May Long Challenge | An Interesting Sequence | ISS | Solution Read More »