APL (Dyalog Unicode), 108 bytes
∨/1~⍨(⊢∨⍳)1~⍨⊢∨⍳
Outputs 1 if it isn't almost-prime, some other positive integer otherwise.
∨/1~⍨(⊢∨⍳)1~⍨⊢∨⍳
(⊢∨⍳) ⍝ All divisors
1~⍨ ⍝ Remove 1
∨/ ⍝ GCD
APL (Dyalog Unicode), 10 bytes
∨/1~⍨(⊢∨⍳)
Outputs 1 if it isn't almost-prime, some other positive integer otherwise.
∨/1~⍨(⊢∨⍳)
(⊢∨⍳) ⍝ All divisors
1~⍨ ⍝ Remove 1
∨/ ⍝ GCD
APL (Dyalog Unicode), 8 bytes
∨/1~⍨⊢∨⍳
Outputs 1 if it isn't almost-prime, some other positive integer otherwise.
∨/1~⍨⊢∨⍳
⊢∨⍳ ⍝ All divisors
1~⍨ ⍝ Remove 1
∨/ ⍝ GCD
APL (Dyalog Unicode), 2210 bytes
3>∘(≢∪)⊢∨/1~⍨(×ばつ⊢⊢∨⍳)1↓⍳
If a non-consistent output is okay,Outputs 1 if it can be 18 bytes (1 or 2 means it'sisn't almost prime-prime, anything greater than that means it isn't):
≢∘∪⊢(×ばつ⊢)1↓⍳
Try it online! some other positive integer otherwise.
3>∘(≢∪)⊢∨/1~⍨(×ばつ⊢⊢∨⍳)1↓⍳
⊢(×ばつ⊢⊢∨⍳)1↓⍳ ⍝ PrimeAll factorizationdivisors
∪ 1~⍨ ⍝ Remove duplicates
≢ ⍝ Length1
3> ∨/ ⍝ Is it less than 3?GCD
APL (Dyalog Unicode), 22 bytes
3>∘(≢∪)⊢(×ばつ⊢)1↓⍳
If a non-consistent output is okay, it can be 18 bytes (1 or 2 means it's almost prime, anything greater than that means it isn't):
≢∘∪⊢(×ばつ⊢)1↓⍳
3>∘(≢∪)⊢(×ばつ⊢)1↓⍳
⊢(×ばつ⊢)1↓⍳ ⍝ Prime factorization
∪ ⍝ Remove duplicates
≢ ⍝ Length
3> ⍝ Is it less than 3?
APL (Dyalog Unicode), 10 bytes
∨/1~⍨(⊢∨⍳)
Outputs 1 if it isn't almost-prime, some other positive integer otherwise.
∨/1~⍨(⊢∨⍳)
(⊢∨⍳) ⍝ All divisors
1~⍨ ⍝ Remove 1
∨/ ⍝ GCD
APL (Dyalog Unicode), 22 bytes
3>∘(≢∪)⊢(×ばつ⊢)1↓⍳
If a non-consistent output is okay, it can be 18 bytes (1 or 2 means it's almost prime, anything greater than that means it isn't):
≢∘∪⊢(×ばつ⊢)1↓⍳
3>∘(≢∪)⊢(×ばつ⊢)1↓⍳
⊢(×ばつ⊢)1↓⍳ ⍝ Prime factorization
∪ ⍝ Remove duplicates
≢ ⍝ Length
3> ⍝ Is it less than 3?