login
For the odd numbers 2n + 1, the least practical number r such that 2n + 1 = r + p where p is prime.
1

%I #22 Jun 19 2023 12:14:52

%S 1,2,2,2,4,2,2,4,2,2,4,2,4,6,2,2,4,6,2,4,2,2,4,2,4,6,2,4,6,2,2,4,6,2,

%T 4,2,2,4,6,2,4,2,4,6,2,4,6,8,2,4,2,2,4,2,2,4,2,4,6,8,16,12,18,2,4,2,4,

%U 6,2,2,4,6,8,12,2,2,4,6,2,4,6,2,4,2,4,6,2,4,6,2,2,4,6,8,12

%N For the odd numbers 2n + 1, the least practical number r such that 2n + 1 = r + p where p is prime.

%C Conjecture by _Hal M. Switkay_: every odd number, beginning with 3, is the sum of a prime number and a practical number. Note that this conjecture occupies the space between the unproven Goldbach conjecture and the theorem that every even number, beginning with 2, is the sum of two practical numbers (Melfi's 1996 proof of Margenstern's conjecture).

%H Amiram Eldar, <a href="/A361289/b361289.txt">Table of n, a(n) for n = 1..10000</a>

%e a(61) = 16, because the 61st odd number is 123 = {(10+113), (14+109), (16+107), ...} and 16 is the least practical number. 10 and 14 are not practical.

%t PracticalQ[n_] := Module[{f, p, e, prod=1, ok=True}, If[n<1 || (n>1 && OddQ[n]), False, If[n==1, True, f=FactorInteger[n]; {p, e}=Transpose[f]; Do[If[p[[i]]>1+DivisorSigma[1, prod], ok=False; Break[]]; prod=prod*p[[i]]^e[[i]], {i, Length[p]}]; ok]]];

%t part[n_, m_] := Module[{p=NextPrime[n, -m], d}, d=n-p; {d, p}];

%t find[n_] := Module[{m=1}, While[!PracticalQ[part[n, m][[1]]], m++]; part[n, m]];

%t Table[find[2 n + 1][[1]], {n, 1, 1000}]

%o (Python)

%o from sympy import factorint, prevprime

%o # Stale copy of code for is_A005153 deleted, please see there. Code duplication potentially creates important problems. - _M. F. Hasler_, Jun 19 2023

%o A361289 = []

%o for odds in range(3,192,2):

%o prime = prevprime(odds)

%o while not is_A005153(odds - prime): prime = prevprime(prime)

%o A361289.append(odds - prime)

%o print(A361289) # _Karl-Heinz Hofmann_, Mar 08 2023

%Y Cf. A005153.

%K nonn

%O 1,2

%A _Frank M Jackson_, Mar 07 2023