A381159 Numbers whose prime divisors all end in the same digit.
1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 39, 41, 43, 47, 49, 53, 59, 61, 64, 67, 69, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 117, 119, 121, 125, 127, 128, 129, 131, 137, 139, 149, 151, 157, 159, 163, 167, 169, 173, 179
Offset: 1
Examples
16, 69, 117 are included in the sequence because 16 = 2*2*2*2, 69 = 3*23, 117 = 3*3*13.
Crossrefs
Programs
-
Maple
q:= n-> nops(map(p-> irem(p, 10), numtheory[factorset](n)))<2: select(q, [$1..250])[]; # Alois P. Heinz, Feb 15 2025
-
Mathematica
q[n_] := SameQ @@ Mod[FactorInteger[n][[;; , 1]], 10]; Select[Range[2, 180], q] (* Amiram Eldar, Feb 16 2025 *)
-
PARI
isok(k) = if (k==1, 1, my(f=factor(k)); #Set(vector(#f~, i, f[i, 1] % 10)) == 1); \\ Michel Marcus, Feb 16 2025
-
Python
from sympy import factorint, isprime def ok(n): return n == 1 or isprime(n) or len(set(p%10 for p in factorint(n))) == 1 print([k for k in range(1, 180) if ok(k)]) # Michael S. Branicky, Feb 16 2025
Comments