OFFSET
1,2
COMMENTS
Equally, 1 if A001358(n) = p^2, otherwise, if A001358(n) = p*q (p, q primes, p < q), then a(n) = A252375(n) = the least r such that r^k <= p < q < r^(k+1), for some k >= 0. - Antti Karttunen, Dec 16 2014
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
For n=31, the n-th semiprime is A001358(31) = 91 = 7*13;
7 = 111_2 = 21_3 = 13_4
and 13 = 1101_2 = 111_3 = 31_4, so a(31) = 4. [corrected by Jon E. Schoenfield, Sep 23 2018]
.
Illustration of initial terms, n <= 25:
. n | A001358(n) = p * q | b = a(n) | p and q in base b
. ----+---------------------+-----------+-------------------
. 1 | 4 2 2 | 1 | [1] [1]
. 2 | 6 2 3 | 2 | [1,0] [1,1]
. 3 | 9 3 3 | 1 | [1,1,1] [1,1,1]
. 4 | ** 10 2 5 | 6 | [2] [5]
. 5 | ** 14 2 7 | 8 | [2] [7]
. 6 | 15 3 5 | 3 | [1,0] [1,2]
. 7 | 21 3 7 | 3 | [1,0] [2,1]
. 8 | ** 22 2 11 | 12 | [2] [11]
. 9 | 25 5 5 | 1 | [1]^5 [1]^5
. 10 | ** 26 2 13 | 14 | [2] [13]
. 11 | ** 33 3 11 | 12 | [3] [11]
. 12 | ** 34 2 17 | 18 | [2] [17]
. 13 | 35 5 7 | 2 | [1,0,1] [1,1,1]
. 14 | ** 38 2 19 | 20 | [2] [19]
. 15 | ** 39 3 13 | 14 | [3] [13]
. 16 | ** 46 2 23 | 24 | [2] [23]
. 17 | 49 7 7 | 1 | [1]^7 [1]^7
. 18 | ** 51 3 17 | 18 | [3] [17]
. 19 | 55 5 11 | 4 | [1,1] [2,3]
. 20 | ** 57 3 19 | 20 | [3] [19]
. 21 | ** 58 2 29 | 30 | [2] [29]
. 22 | ** 62 2 31 | 32 | [2] [31]
. 23 | 65 5 13 | 4 | [1,1] [3,1]
. 24 | ** 69 3 23 | 24 | [3] [23]
. 25 | ** 74 2 37 | 38 | [2] [37]
semiprimes marked with ** indicate terms of A138511, i.e. b = q + 1.
PROG
(Haskell)
import Data.List (genericIndex, unfoldr); import Data.Tuple (swap)
import Data.Maybe (mapMaybe)
a138510 n = genericIndex a138510_list (n - 1)
a138510_list = mapMaybe f [1..] where
f x | a010051' q == 0 = Nothing
| q == p = Just 1
| otherwise = Just $
head [b | b <- [2..], length (d b p) == length (d b q)]
where q = div x p; p = a020639 x
d b = unfoldr (\z -> if z == 0 then Nothing else Just $ swap $ divMod z b)
-- Reinhard Zumkeller, Dec 16 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Mar 21 2008
EXTENSIONS
Wrong comment corrected by Reinhard Zumkeller, Dec 16 2014
STATUS
approved