OFFSET
1,2
COMMENTS
51st All-Russian Mathematical Olympiad for Schoolchildren. Problem. Let us call a natural number "lopsided" if it is greater than 1 and all its prime divisors end with the same digit. Is there an increasing arithmetic progression with a difference not exceeding 2025, consisting of 150 natural numbers, each of which is "lopsided"? (A. Chironov)
All powers of primes (A000961) are terms.
EXAMPLE
16, 69, 117 are included in the sequence because 16 = 2*2*2*2, 69 = 3*23, 117 = 3*3*13.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alexander M. Domashenko, Feb 15 2025
STATUS
approved