/* Predicate function that checks wether a positive integer is generalized k-Curzon number or not */ g_curzonp(n,k):=if mod((k^n)+1,k*n+1)=0 then true$ /* Function that returns a list of the first len generalized k-Curzon numbers */ g_curzon_count(len,k):=block( [i:1,count:0,result:[]], while count