# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a251725 Showing 1-1 of 1 %I A251725 #16 Jun 30 2019 10:16:14 %S A251725 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, %T A251725 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, %U A251725 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 %N A251725 Smallest number b such that in base-b representation the prime factors of n have equal lengths. %C A251725 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. %H A251725 Antti Karttunen, Table of n, a(n) for n = 1..10000 %F A251725 Other identities. For all n >= 1: %F A251725 A138510(n) = a(A001358(n)). %F A251725 a(n) = a(A066048(n)). [The result depends only on the smallest and the largest prime factor of n.] %o A251725 (MIT/GNU Scheme) %o A251725 ;; Factorization function ifactor can be found in _Antti Karttunen_'s IntSeq-library, and code for A162319bi given in A162319: %o A251725 (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))))))))) %o A251725 (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)))))))))) %o A251725 (Haskell) %o A251725 import Data.List (unfoldr); import Data.Tuple (swap) %o A251725 a251725 1 = 1 %o A251725 a251725 n = if length ps == 1 then 1 else head $ filter f [2..] where %o A251725 f b = all (== len) lbs where len:lbs = map (length . d b) ps %o A251725 ps = a027748_row n %o A251725 d b = unfoldr (\z -> if z == 0 then Nothing else Just $ swap $ divMod z b) %o A251725 -- _Reinhard Zumkeller_, Dec 17 2014 %Y A251725 Cf. A252375 (variant). %Y A251725 Cf. A251726 (those n > 1 for which a(n) <= A006530(n)). %Y A251725 Cf. A251727 (those n for which a(n) = A006530(n)+1). %Y A251725 Cf. A000961 (positions of ones). %Y A251725 Cf. A001358, A006530, A020639, A066048, A138510, A162319. %Y A251725 Cf. A027748. %K A251725 nonn,base %O A251725 1,6 %A A251725 _Antti Karttunen_, Dec 16 2014 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE