diff --git a/neet/boolean/logicnetwork.py b/neet/boolean/logicnetwork.py
index b9342f1..b173fdf 100644
--- a/neet/boolean/logicnetwork.py
+++ b/neet/boolean/logicnetwork.py
@@ -109,13 +109,13 @@ class LogicNetwork(object):
             # Encode the mask.
             mask_code = long(0)
             for idx in indices:
-                mask_code += 2 ** idx  # Low order, low index.
+                mask_code += 2 ** long(idx)  # Low order, low index.
             # Encode each condition of truth table.
             encoded_sub_table = set()
             for condition in conditions:
                 encoded_condition = long(0)
                 for idx, state in zip(indices, condition):
-                    encoded_condition += 2 ** idx if long(state) else 0
+                    encoded_condition += 2 ** long(idx) if int(state) else 0
                 encoded_sub_table.add(encoded_condition)
             self._encoded_table.append((mask_code, encoded_sub_table))
 

LogicNetwork table encoding issue
See comments on the team_grn slack channel.  I'll add more here later.
diff --git a/test/test_logic.py b/test/test_logic.py
index 523d2d9..304c019 100644
--- a/test/test_logic.py
+++ b/test/test_logic.py
@@ -2,7 +2,8 @@
 # Use of this source code is governed by a MIT
 # license that can be found in the LICENSE file.
 """Unit test for LogicNetwork"""
-import unittest
+import unittest, numpy as np
+from neet.python3 import *
 from neet.boolean import LogicNetwork
 from neet.exceptions import FormatError
 
@@ -27,6 +28,16 @@ class TestLogicNetwork(unittest.TestCase):
         self.assertEqual(['A', 'B'], net.names)
         self.assertEqual([(2, {0, 2}), (1, {1})], net._encoded_table)
 
+    def test_init_long(self):
+        table = [((), set()) for _ in range(65)]
+        table[0] = ((np.int64(64),), set('1'))
+
+        mask = long(2)**64
+
+        net = LogicNetwork(table)
+        self.assertEqual(net.table, table)
+        self.assertEqual(net._encoded_table[0], (mask, set([mask])))
+
     def test_inplace_update(self):
         net = LogicNetwork([((1,), {'0', '1'}), ((0,), {'1'})])
         state = [0, 1]

pip install -e .
parse_log_pytest
requirements.txt
nose nose-cov pytest
apt-get update apt-get install -y gcc
3.5
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
cov-core==1.15.0
coverage==6.2
decorator==4.4.2
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/ELIFE-ASU/Neet.git@041332432596020896894dbaa66282010db9e065#egg=neet
networkx==2.5.1
nose==1.3.7
nose-cov==1.6
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyinform==0.2.0
pyparsing==3.1.4
pytest==7.0.1
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: Neet
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - cov-core==1.15.0
      - coverage==6.2
      - decorator==4.4.2
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - networkx==2.5.1
      - nose==1.3.7
      - nose-cov==1.6
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyinform==0.2.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/Neet

test/test_logic.py::TestLogicNetwork::test_init_long
test/test_logic.py::TestLogicNetwork::test_has_metadata test/test_logic.py::TestLogicNetwork::test_init test/test_logic.py::TestLogicNetwork::test_inplace_update test/test_logic.py::TestLogicNetwork::test_is_fixed_sized test/test_logic.py::TestLogicNetwork::test_is_network test/test_logic.py::TestLogicNetwork::test_logic_simple_read test/test_logic.py::TestLogicNetwork::test_logic_simple_read_custom_comment test/test_logic.py::TestLogicNetwork::test_logic_simple_read_empty test/test_logic.py::TestLogicNetwork::test_logic_simple_read_no_commas test/test_logic.py::TestLogicNetwork::test_logic_simple_read_no_header test/test_logic.py::TestLogicNetwork::test_logic_simple_read_no_node_headers test/test_logic.py::TestLogicNetwork::test_neighbors_both test/test_logic.py::TestLogicNetwork::test_neighbors_in test/test_logic.py::TestLogicNetwork::test_neighbors_out test/test_logic.py::TestLogicNetwork::test_node_dependency test/test_logic.py::TestLogicNetwork::test_reduce_table test/test_logic.py::TestLogicNetwork::test_to_networkx_graph_names test/test_logic.py::TestLogicNetwork::test_to_networkx_graph_names_fail test/test_logic.py::TestLogicNetwork::test_to_networkx_metadata test/test_logic.py::TestLogicNetwork::test_update test/test_logic.py::TestLogicNetwork::test_update_exceptions
neet/boolean/logicnetwork.py
neet/boolean/logicnetwork.py