A350230 Numbers m such that for all factorizations m=a*b with positive integers (a, b), a*b+a+b is a prime.
1, 2, 3, 5, 6, 11, 14, 15, 21, 23, 26, 29, 30, 33, 35, 41, 51, 53, 65, 74, 83, 86, 89, 111, 113, 131, 141, 155, 158, 173, 179, 186, 191, 194, 209, 215, 221, 230, 231, 233, 239, 251, 254, 278, 281, 293, 321, 323, 326, 329, 341, 345, 359, 371, 398, 413, 419, 426
Offset: 1
Keywords
Examples
1 is in the sequence because 1 = 1*1 and 1*1 + 1 + 1 = 3 is prime; 30 is in the sequence because A038548(30) = 4 has 4 factorizations: 30 = 1*30 = 2*15 = 3*10 = 5*6 and 30 + 1 + 30 = 61 is prime; 30 + 2 + 15 = 47 is prime; 30 + 3 + 10 = 43 is prime; 30 + 5 + 6 = 41 is prime.
Programs
-
Magma
[n:n in [1..450]|forall{d: d in Divisors(n)| IsPrime(n+d+n div d)}]; // Marius A. Burtea, Dec 26 2021
-
Maple
A350230 := proc(n) local a,b ; for a in numtheory[divisors](n) do b := n/a ; if not isprime(a*b+b+a) then return false; end if; end do: true ; end proc: for n from 1 to 500 do if isA350230(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Jan 24 2022
-
Mathematica
t={};Do[ds=Divisors[n];If[EvenQ[Length[ds]],ok=True;k=1;While[k<=Length[ds]/2&&(ok=PrimeQ[ds[[k]]*ds[[-k]]+ds[[k]]+ds[[-k]]]),k++];If[ok,AppendTo[t,n]]],{n,2,4000}];t
-
PARI
isok(m) = sumdiv(m, d, isprime(m+d+m/d)) == numdiv(m); \\ Michel Marcus, Dec 25 2021
-
Python
from sympy import divisors, isprime def ok(n): divs = divisors(n) if n == 0: return False return all(isprime(a*b+a+b) for a, b in ((d, n//d) for d in divs)) print([k for k in range(427) if ok(k)]) # Michael S. Branicky, Dec 21 2021
Comments