code: public static Integer guessBasePortFromOffsetPort(final int port) {
      if ((port >= 3600) && (port <= 3699)) {
        final int suffix = port % 100;
        int image = suffix / 10 * 10;
        int offset = suffix % 10;
        if (suffix / 10 % 2 == 1) {
          image = image - 10;
          offset = offset + 10;
        }
        if ((offset == 0) || isAPortOffset(offset)) {
          return 3600 + image;
        }
      }
      return null;
    }
docs: Attempts to guess the base port of a CycAddress from an offset port. For example, given a port
  of 3654, we can <em>somewhat</em> safely guess that the base port would be 3640.
  
  <p>
  Be <em>very careful</em> with this method. It is <em>only a guess</em>, and this method can
  (and has!) been wrong before. There's no guarantee that a Cyc server will be running in the
  3600 block; if a Cyc server is running at, e.g., 3780 (which is rare, but entirely possible),
  and this method is given '80', it will incorrectly guess that the base port is 3680. In short,
  any time you use this method, make sure that any potential errors are visible to users, and can
  reasonably be corrected by them.
  
  @param port
  
  @return the base port number