Krishna iResearch Intelligent Cloud Platform - acadpdrafts
complement.py
1 #-------------------------------------------------------------------------`
2 #ASFER - a ruleminer which gets rules specific to a query and executes them
3 #Copyright (C) 2009-2013 Ka.Shrinivaasan
4 #This program is free software: you can redistribute it and/or modify
5 #it under the terms of the GNU General Public License as published by
6 #the Free Software Foundation, either version 3 of the License, or
7 #(at your option) any later version.
8 #This program is distributed in the hope that it will be useful,
9 #but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 #GNU General Public License for more details.
12 #You should have received a copy of the GNU General Public License
13 #along with this program. If not, see <http://www.gnu.org/licenses/>.
14 #
15 #--------------------------------------------------------------------------------------------------------
16 #Srinivasan Kannan (alias) Ka.Shrinivaasan (alias) Shrinivas Kannan
17 #Independent Open Source Developer, Researcher and Consultant
18 #Ph: 9003082186, 9791165980
19 #Open Source Products Profile(Krishna iResearch): http://sourceforge.net/users/ka_shrinivaasan
20 #Personal website(research): https://sites.google.com/site/kuja27/
21 #emails: ka.shrinivaasan@gmail.com, shrinivas.kannan@gmail.com, kashrinivaasan@live.com
22 #--------------------------------------------------------------------------------------------------------
23 
24 ################################################################################################
25 # Test python script written in March 2011 While at CMI as JRF for
26 # "Decidability of Existence and Construction of a Complement of a given Function" :
27 # http://arxiv.org/abs/1106.4102 and
28 # https://sites.google.com/site/kuja27/ComplementOfAFunction_earlier_draft.pdf?attredirects=0
29 # Added to repository for numerical pattern analysis mentioned in http://sourceforge.net/p/asfer/code/HEAD/tree/AstroInferDesign.txt
30 ################################################################################################
31 
32 Lf=[2,3,5,7,11,13,17,19,23]
33 
34 def getgofx(x):
35  u=0
36  z=-1
37  while True:
38  if u in Lf:
39  u=u+1
40  if u not in Lf:
41  z=z+1
42  if (z==x):
43  return u
44  else:
45  u=u+1
46 
47 
48 for i in range(10):
49  print "g(",i,")=",getgofx(i)