cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A138510 Smallest number b such that in base b the prime factors of the n-th semiprime (A001358) have equal lengths.

This page as a plain text file.
%I A138510 #23 Sep 23 2018 22:30:26
%S A138510 1,2,1,6,8,3,3,12,1,14,12,18,2,20,14,24,1,18,4,20,30,32,4,24,38,4,42,
%T A138510 5,44,30,4,32,48,5,54,38,5,60,5,1,62,42,44,5,68,48,72,2,30,74,32,80,
%U A138510 54,5,84,1,60,90,62,38,3,98,68,102,6,42,104,3,72,108,44,6,110,74,3,114,48,80
%N A138510 Smallest number b such that in base b the prime factors of the n-th semiprime (A001358) have equal lengths.
%C A138510 a(n) = 1 iff A001358(n) is the square of a prime (A001248);
%C A138510 a(A174956(A138511(n))) = A084127(A174956(A138511(n))) + 1.
%C A138510 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
%C A138510 a(A174956(A085721(n))) <= 2. - _Reinhard Zumkeller_, Dec 19 2014
%H A138510 Reinhard Zumkeller, <a href="/A138510/b138510.txt">Table of n, a(n) for n = 1..10000</a>
%F A138510 a(n) = A251725(A001358(n)). - _Antti Karttunen_, Dec 16 2014
%e A138510 For n=31, the n-th semiprime is A001358(31) = 91 = 7*13;
%e A138510      7 =  111_2 =  21_3 = 13_4
%e A138510 and 13 = 1101_2 = 111_3 = 31_4, so a(31) = 4. [corrected by _Jon E. Schoenfield_, Sep 23 2018]
%e A138510 .
%e A138510 Illustration of initial terms, n <= 25:
%e A138510 .   n | A001358(n) =  p * q |  b = a(n) | p and q in base b
%e A138510 . ----+---------------------+-----------+-------------------
%e A138510 .   1 |       4       2   2 |      1    |     [1]        [1]
%e A138510 .   2 |       6       2   3 |      2    |   [1,0]      [1,1]
%e A138510 .   3 |       9       3   3 |      1    | [1,1,1]    [1,1,1]
%e A138510 .   4 |  **  10       2   5 |      6    |     [2]        [5]
%e A138510 .   5 |  **  14       2   7 |      8    |     [2]        [7]
%e A138510 .   6 |      15       3   5 |      3    |   [1,0]      [1,2]
%e A138510 .   7 |      21       3   7 |      3    |   [1,0]      [2,1]
%e A138510 .   8 |  **  22       2  11 |     12    |     [2]       [11]
%e A138510 .   9 |      25       5   5 |      1    |   [1]^5      [1]^5
%e A138510 .  10 |  **  26       2  13 |     14    |     [2]       [13]
%e A138510 .  11 |  **  33       3  11 |     12    |     [3]       [11]
%e A138510 .  12 |  **  34       2  17 |     18    |     [2]       [17]
%e A138510 .  13 |      35       5   7 |      2    | [1,0,1]    [1,1,1]
%e A138510 .  14 |  **  38       2  19 |     20    |     [2]       [19]
%e A138510 .  15 |  **  39       3  13 |     14    |     [3]       [13]
%e A138510 .  16 |  **  46       2  23 |     24    |     [2]       [23]
%e A138510 .  17 |      49       7   7 |      1    |   [1]^7      [1]^7
%e A138510 .  18 |  **  51       3  17 |     18    |     [3]       [17]
%e A138510 .  19 |      55       5  11 |      4    |   [1,1]      [2,3]
%e A138510 .  20 |  **  57       3  19 |     20    |     [3]       [19]
%e A138510 .  21 |  **  58       2  29 |     30    |     [2]       [29]
%e A138510 .  22 |  **  62       2  31 |     32    |     [2]       [31]
%e A138510 .  23 |      65       5  13 |      4    |   [1,1]      [3,1]
%e A138510 .  24 |  **  69       3  23 |     24    |     [3]       [23]
%e A138510 .  25 |  **  74       2  37 |     38    |     [2]       [37]
%e A138510 where p = A084126(n) and q = A084127(n),
%e A138510 semiprimes marked with ** indicate terms of A138511, i.e. b = q + 1.
%o A138510 (Haskell)
%o A138510 import Data.List (genericIndex, unfoldr); import Data.Tuple (swap)
%o A138510 import Data.Maybe (mapMaybe)
%o A138510 a138510 n = genericIndex a138510_list (n - 1)
%o A138510 a138510_list = mapMaybe f [1..] where
%o A138510   f x | a010051' q == 0 = Nothing
%o A138510       | q == p          = Just 1
%o A138510       | otherwise       = Just $
%o A138510         head [b | b <- [2..], length (d b p) == length (d b q)]
%o A138510       where q = div x p; p = a020639 x
%o A138510   d b = unfoldr (\z -> if z == 0 then Nothing else Just $ swap $ divMod z b)
%o A138510 -- _Reinhard Zumkeller_, Dec 16 2014
%o A138510 (Scheme) (define (A138510 n) (A251725 (A001358 n))) ;; _Antti Karttunen_, Dec 16 2014
%Y A138510 Cf. A078972, A085721.
%Y A138510 Cf. A138511, A251728, A252375, A084127, A020639, A162319, A174956, A001358.
%K A138510 nonn,base
%O A138510 1,2
%A A138510 _Reinhard Zumkeller_, Mar 21 2008
%E A138510 Wrong comment corrected by _Reinhard Zumkeller_, Dec 16 2014