1 121 12421 1248421 print these in C programming?

the series continues with the length of odd series ie.1,3,5,7...so on.the middle integer is extra sdded in every number.it's general structure is

(inital numbers)(extra number)(reverse of initial numbers)

extra number is always multplied by 2 with last extra number added

char s[50];

s[0]=1;

for(i=1;i<n;i++)

{

traverse the array to next middle position

add the extra element in between the elements

concatenate the reverse part of initial elements

}

this can b done as

for(i=1,j=0;i<n;i=strlen(s),j++)

{

for(k=i;k>j;k--)

{

s[k+1]=s[k];

}

s[j+1]=s[j-1]*2;

s[i+3]='\0';

print s;

}