A finite portion of an arithmetic progression is called a finite arithmetic progression and sometimes just called an arithmetic progression. The sum of a finite arithmetic progression is called an arithmetic series.Write a Python program to generate a list of numbers in the arithmetic progression star...
代码如下: classSolution(object):defcanMakeArithmeticProgression(self, arr):""":type arr: List[int] :rtype: bool"""arr.sort() diff= arr[1] -arr[0]foriinrange(1,len(arr)-1):ifdiff != arr[i+1] -arr[i]:returnFalsereturnTrue...
diff= (arr[-1] - arr[0])/(len(arr))foriinrange(len(arr)-1):ifarr[i] + diff != arr[i+1]:returnarr[i] +diffreturnarr[0]
Lipmaa, H.: Progression-free sets and sublinear pairing-based non-interactive zero-knowledge arguments. In: Cramer, R. (ed.) TCC 2012. LNCS, vol. 7194, pp. 169–189. Springer, Heidelberg (2012) Chapter Google Scholar Möller, B.: Algorithms for multi-exponentiation. In: Vaudenay, S....