Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You worry too much about your job. Stop it. You are not paid enough to worry.


comp / comp.lang.python / Relatively prime integers in NumPy

SubjectAuthor
o Relatively prime integers in NumPyPopov, Dmitry Yu

1
Subject: Relatively prime integers in NumPy
From: Popov, Dmitry Yu
Newsgroups: comp.lang.python
Date: Mon, 8 Jul 2024 19:09 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: dpopov@anl.gov (Popov, Dmitry Yu)
Newsgroups: comp.lang.python
Subject: Relatively prime integers in NumPy
Date: Mon, 8 Jul 2024 19:09:45 +0000
Lines: 18
Message-ID: <mailman.28.1720707316.2981.python-list@python.org>
References: <SA0PR09MB6363F3E6B493202E73869DF4DBDA2@SA0PR09MB6363.namprd09.prod.outlook.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de kNoW57hRhkwBKP7iOe/k5gOrNDTVewrgisohSVJMUnvg==
Cancel-Lock: sha1:P+7XNDP/oGxECWFab4W5TkDlFjg= sha256:BCctCYooTBfFGr3sSiuBMjbx4o38yOP5ubwh+KxpJt4=
Return-Path: <dpopov@anl.gov>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=anl.gov header.i=@anl.gov header.b=bvjn2fb0;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: UNSURE 0.292
X-Spam-Level: **
X-Spam-Evidence: '*H*': 0.54; '*S*': 0.13; 'mechanism': 0.09; 'numpy':
0.09; 'prime': 0.16; 'received:namprd09.prod.outlook.com': 0.16;
'relatively': 0.16; 'to:addr:python-list': 0.20; 'i.e.': 0.22;
'function': 0.27; 'example,': 0.28; 'those': 0.36; 'usa': 0.60;
'provide': 0.60; 'dear': 0.62; 'identify': 0.64; 'imagine': 0.64;
'numbers': 0.67; 'factor': 0.69; 'charset:iso-8859-1': 0.73;
'factors': 0.76; 'axis': 0.84; 'popov': 0.84
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=a5tayNLaEkjIZL/B5fqT/O9JYWfL7/n5Z0ozeq4Ad2H4S2TyqCFR8rcX9+3ulQ3YAi4u9QRnQeq6ixAvxTsOdCLN6lIISxbR5ZjErLX1MbVEUxm7OhvpmmD3HyA4sf7R3IYUdxjKQMbTPBqATg9oYUoxWr4Vbgt3LjlswQStaHZajOuJ0YNmg/XE5GbKxXPmnZn+TG9/VPOMgcYL8BujzFlK6lL+I4BEJcvdofumuQTn20sDEQNKn8xA7hxWEMeFiMqwr6hOFS4A0nldhJe9/gKgPJ1w0veogmDAfXT9IUKLCpWs9khPWiOuXglTJ2R3fo1/Dbw7FSvwDX2n4hC0YA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=RaU43G3gpC2TOUvAZOEG84Siu9NbeY8nWF1X5ONSuqs=;
b=kMbyXidr738II1PZdV8qTLgxcBajcKp07x8+twPRLLMtvNvWqZb6Nkz9zF8kNrXGXsWSDlNYLlFAuFGXrWxOKJyrlILjNLTJQ2NhAMV+HfiXGd3XgWOkh5mFrItwRvRLm/i6vHHxifvZFy246TPLZxcFDo0hyZ4fzTo2lEr0fgUO5o+h8RAGl7B6eOvWmhnI8HSZUczJx9/I/4FbwL1Tewgx4yw1Lu8Hs/ClYuQr0ByuOkZuFE3WRw7K952VKte8dJVxXcaxlWX5DOJbkBldhmno9pSC0MizwTmjpxW0pfV/GHqCUKks469Cubcrdv5YbAgXLpCMdU8hNZ5xSsp4YA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=anl.gov; dmarc=pass action=none header.from=anl.gov; dkim=pass
header.d=anl.gov; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anl.gov; s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=RaU43G3gpC2TOUvAZOEG84Siu9NbeY8nWF1X5ONSuqs=;
b=bvjn2fb0b2r+p1yCW2wmp86D8ea/4oRF+ccUC7UdoZpslVtVbHp1tFuBjv+dx738rx+7JEvlSMOiA9BhAQ0rzcGxYaBtiais788IdztA6UHb3K16NUMIHXCBEHipzKH9spJc83zUvJcIptAU2WKhpgQkHGPQ3dsnU8yVwYONh9kMlISVrm4lRaYpMtWfigL7Lh5WOHK8wjjb/yl3qdl27T4j1VoqUFyXrUEznyoxMnyS7TL5doa2qF8Lp1r5MPLDp3QUbvxD8DGiczvrkZKZZR8S3k0PghVUFLa74cvDR1Jk18x3soSkfD0CRlOsmb7ofzqce8YL/i+1r917pPE2yw==
Thread-Topic: Relatively prime integers in NumPy
Thread-Index: AQHa0WffJqhGflnACk65nSD3UBURMQ==
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=anl.gov;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA0PR09MB6363:EE_|MW4PR09MB9060:EE_
x-ms-office365-filtering-correlation-id: 6a26e1a3-bc12-43bc-253d-08dc9f818779
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|38070700018;
x-microsoft-antispam-message-info: 5a0Lp0lkIug2fKd8mD9w4BOa7T5UAUCh6cptduu1aCBRMC5+abYmaha6v/
YFwsVw/NemeE9B5/RoljHTg0C8L53AOByBMlLeo4WNGUpQ+P624npmU3FO
c3RxYdRanGUKZfEYZLfUYji5+tp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DK16LV
NwKil8DPgvmcC7JwUyY0le4gfw5VltKS2HV4x9a8nRTJ4ujqN1wuymEmeL
EI0TRmUpyLucvHtIAdHZs+rBzr21gN1mYCs76aVDFaSeWp0F08Tn8bl/mn
ZTFaEhpPo2v+EN8Xd7lP2oVuZ1d8uOd8BNxFylF2RDpDpZhgT1Rccfa4Gu
42MrmhRzoP6PrGNCFzhkzuAoD1KXqJbNfufYJg==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:SA0PR09MB6363.namprd09.prod.outlook.com; PTR:; CAT:NONE;
SFS:(13230040)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: jbLWIJXpx3KBTpr6TlYnenG1P7tJyowVz1M0vvfVTGvtgvE7RU/9RxV3Wr
NDCjmcNdUIYdzog0QRY70lCZLr1qnDdmc9Hz20NPJclWolJf7L7m3rMxaB
VebfauN3e+TIWklYYsMeSCVqc5XmvbL1bcDhkWJ9acx4hzgP4hioXXIuVs
2xF0oe9EYfy1CSyk3sCzFCaTSvb2YJIsw3d66eUQoubi77++LVvhmLoSp3
nlO0q+thOnJm4Il0kU3I+NtqqkHs3cIDOEvHkfBVs9GJCbLaGHuEDt0u7p
2JXeSktjAo5QG1bL34Q+vXfnQscr2Ok5/iiozubVmy57DtHO/YmkudlsHY
xUXiXum9Aqu5ss9w5YdKkSNkiLWmtx40IWE+4rnGzdz00zk/sN5UbHQDQw
ocE/Lsu2QxxjwHdjZdRzzNJBaqsa4dzPs8oYA8KDcFvNxzOU5tOhrX26eN
pzwZ/iiavKroSwAL4Yp7u92uddGF1O0b9RB2P6/Hg9vqA6XzhaNs3m8IyM
NhzQcl2Y94R/RqB6uhJuhQ3C0aVlzHPynyCUFLVsQITpdiCAE+FTVGEmh3
9gIYH4vvEV9zvfuF369c67w7Ji64jlEwsOPAAO7H16GfyMhDK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ange-CrossTenant-Network-Message-Id: 6a26e1a3-bc12-43bc-253d-08dc9f818779
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 19:09:45.1710 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 0cfca185-25f7-49e3-8ae7-704d5326e285
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR09MB9060
X-Mailman-Approved-At: Thu, 11 Jul 2024 10:15:15 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <SA0PR09MB6363F3E6B493202E73869DF4DBDA2@SA0PR09MB6363.namprd09.prod.outlook.com>
View all headers

Dear Sirs.

Does NumPy provide a simple mechanism to identify relatively prime integers, i.e. integers which don't have a common factor other than +1 or -1? For example, in case of this array:
[[1,5,8],
[2,4,8],
[3,3,9]]
I can imagine a function which would return array of common factors along axis 0: [1,2,3]. Those triples of numbers along axis 1 with the factor of1 or -1 would be relatively prime integers.

Regards,
Dmitry Popov

Argonne, IL
USA

1

rocksolid light 0.9.8
clearnet tor