login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A361301 For the odd number 2n + 1, the least primitive practical number r such that 2n + 1 = r + p where p is prime. 1

%I #34 Jun 21 2023 12:48:09

%S 1,2,2,2,6,2,2,6,2,2,6,2,20,6,2,2,6,6,2,28,2,2,6,2,20,6,2,20,6,2,2,6,

%T 6,2,28,2,2,6,6,2,30,2,20,6,2,20,6,30,2,28,2,2,6,2,2,6,2,20,6,20,20,

%U 28,20,2,28,2,28,6,2,2,6,6,20,42,2,2,6,6,2,30,6,2,28,2,20,6,2,20,6,2,2,6,6,88,28

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

%C Conjecture: every odd number, beginning with 3, is the sum of a prime number and a primitive practical number. This is a tighter conjecture than that posed by _Hal M. Switkay_ (see comments of A005153).

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

%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 DivFreeQ[n_] := Module[{plst=First/@Select[FactorInteger[n], #[[2]]>1 &], m, ok=False}, Do[If[! PracticalQ[n/plst[[m]]], ok=True, ok=False; Break[]], {m, 1, Length@plst}]; ok];

%t PPracticalQ[n_] := PracticalQ[n] && (SquareFreeQ[n] || DivFreeQ[n]);

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

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

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

%o (Python)

%o from sympy import prevprime, factorint

%o # See A005153 for is_A005153(). - _M. F. Hasler_, Jun 19 2023

%o def is_primitive(n):

%o for i in range(0, len(list(factorint(n)))):

%o if list(factorint(n).values())[i] > 1:

%o if is_A005153(n//list(factorint(n))[i]): return False

%o return True

%o def is_A267124(n):

%o if is_A005153(n) and is_primitive(n) : return True

%o A361301 = []

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

%o prime = prevprime(odds)

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

%o A361301.append(odds - prime)

%o print(A361301) # _Karl-Heinz Hofmann_, Mar 10 2023

%Y Cf. A005153, A267124.

%K nonn

%O 1,2

%A _Frank M Jackson_, Mar 08 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 16 20:46 EDT 2024. Contains 374358 sequences. (Running on oeis4.)