login
A251725
Smallest number b such that in base-b representation the prime factors of n have equal lengths.
5
1, 1, 1, 1, 1, 2, 1, 1, 1, 6, 1, 2, 1, 8, 3, 1, 1, 2, 1, 6, 3, 12, 1, 2, 1, 14, 1, 8, 1, 6, 1, 1, 12, 18, 2, 2, 1, 20, 14, 6, 1, 8, 1, 12, 3, 24, 1, 2, 1, 6, 18, 14, 1, 2, 4, 8, 20, 30, 1, 6, 1, 32, 3, 1, 4, 12, 1, 18, 24, 8, 1, 2, 1, 38, 3, 20, 4, 14, 1, 6, 1, 42, 1, 8, 5, 44, 30, 12, 1, 6, 4, 24, 32, 48, 5, 2, 1, 8, 12, 6
OFFSET
1,6
COMMENTS
The "base-1" is here same as "unary base", where n is represented with digit "1" replicated n times. Thus if and only if n is in A000961 (is a power of prime), a(n) = 1. See A252375 for a more consistent treatment of those cases.
LINKS
FORMULA
Other identities. For all n >= 1:
A138510(n) = a(A001358(n)).
a(n) = a(A066048(n)). [The result depends only on the smallest and the largest prime factor of n.]
PROG
(MIT/GNU Scheme)
;; Factorization function ifactor can be found in Antti Karttunen's IntSeq-library, and code for A162319bi given in A162319:
(define (A251725 n) (let ((spf (A020639 n)) (gpf (A006530 n))) (if (= spf gpf) 1 (let outerloop ((k 2)) (let innerloop ((r 1)) (cond ((and (<= r spf) (< gpf (* k r))) k) ((<= r spf) (innerloop (* k r))) (else (outerloop (+ 1 k)))))))))
(define (A251725 n) (if (= 1 n) 1 (let ((fs (uniq (ifactor n)))) (if (= 1 (length fs)) 1 (let outerloop ((base 2)) (let innerloop ((fs fs) (prevlen #f)) (cond ((null? fs) base) ((not prevlen) (innerloop (cdr fs) (A162319bi (car fs) base))) ((= (A162319bi (car fs) base) prevlen) (innerloop (cdr fs) prevlen)) (else (outerloop (+ 1 base))))))))))
(Haskell)
import Data.List (unfoldr); import Data.Tuple (swap)
a251725 1 = 1
a251725 n = if length ps == 1 then 1 else head $ filter f [2..] where
f b = all (== len) lbs where len:lbs = map (length . d b) ps
ps = a027748_row n
d b = unfoldr (\z -> if z == 0 then Nothing else Just $ swap $ divMod z b)
-- Reinhard Zumkeller, Dec 17 2014
CROSSREFS
Cf. A252375 (variant).
Cf. A251726 (those n > 1 for which a(n) <= A006530(n)).
Cf. A251727 (those n for which a(n) = A006530(n)+1).
Cf. A000961 (positions of ones).
Cf. A027748.
Sequence in context: A157118 A156186 A156233 * A292977 A295381 A351420
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 16 2014
STATUS
approved