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.

Showing 1-7 of 7 results.

A078972 Brilliant numbers: semiprimes (products of two primes, A001358) whose prime factors have the same number of decimal digits.

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 25, 35, 49, 121, 143, 169, 187, 209, 221, 247, 253, 289, 299, 319, 323, 341, 361, 377, 391, 403, 407, 437, 451, 473, 481, 493, 517, 527, 529, 533, 551, 559, 583, 589, 611, 629, 649, 667, 671, 689, 697, 703, 713, 731, 737, 767, 779, 781
Offset: 1

Views

Author

Jason Earls, Jan 12 2003

Keywords

Comments

"Brilliant numbers, as defined by Peter Wallrodt, are numbers with two prime factors of the same length (in decimal notation). These numbers are generally used for cryptographic purposes and for testing the performance of prime factoring programs." [Alpern]
Up to 10^8 the approximate sum of reciprocals is ~1.232884485... - Jason Earls, Oct 15 2010
Let f(n) = a(n) - floor(sqrt(a(n)))^2, or how much larger a(n) is than the largest square number <= a(n). Then f(n) is odd for all even squares, and even for all odd squares where n > 5. See "Ulam spiral" in links. - Christian N. K. Anderson, Jun 12 2013

Examples

			1711 = 29*59 is in the sequence since both of its factors have two digits.
		

References

  • P. D. James, The Private Patient, Knopf, NY, 2008, p. 192. (from N. J. A. Sloane, Aug 27 2009)

Crossrefs

Programs

  • Haskell
    import Data.Function (on)
    a078972 n = a078972_list !! (n-1)
    a078972_list = filter brilliant a001358_list where
       brilliant x = (on (==) a055642) p (x `div` p) where p = a020639 x
    -- Reinhard Zumkeller, Nov 10 2013, Mar 22 2014
    
  • Mathematica
    fQ[n_] := Block[{fi = FactorInteger@n}, Plus @@ Last /@ fi == 2 && Floor[ Log[10, fi[[1, 1]] ]] == Floor[ Log[10, fi[[ -1, 1]] ]]]; Select[ Range@792, fQ@# &] (* Robert G. Wilson v, May 26 2006 *)
    Select[Range[800],PrimeOmega[#]==2&&Length[Union[IntegerLength[FactorInteger[#][[;;,1]]]]]==1&] (* Harvey P. Dale, Jan 24 2025 *)
    Select[Range@1000, Differences@IntegerLength@Flatten@(ConstantArray@@#&/@FactorInteger[#]) == {0} &] (* Hans Rudolf Widmer, Oct 25 2022 *)
    dlist2[d_] := Union[Times @@@ Tuples[Prime[Range[PrimePi[10^(d-1)] + 1, PrimePi[10^d]]], 2]]; (* Generates terms with d-digits prime factors *)
    Flatten[Array[dlist2, 2]] (* Paolo Xausa, Oct 05 2024 *)
  • PARI
    is(n)=my(f=factor(n));(#f[,1]==1 && f[1,2]==2) || (#f[,1]==2 && f[1,2]==1 && f[2,2]==1 && #Str(f[1,1])==#Str(f[2,1])) \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    from sympy import sieve
    A078972 = []
    for n in range(3):
        pr = list(sieve.primerange(10**n,10**(n+1)))
        for i,p in enumerate(pr):
            for q in pr[i:]:
                A078972.append(p*q)
    A078972 = sorted(A078972)
    # Chai Wah Wu, Aug 26 2014

Formula

a(n) = A239585(n) * A239586(n). - Reinhard Zumkeller, Mar 22 2014

Extensions

Edited by N. J. A. Sloane, Aug 27 2009

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 21 2008

Keywords

Comments

a(n) = 1 iff A001358(n) is the square of a prime (A001248);
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
a(A174956(A085721(n))) <= 2. - Reinhard Zumkeller, Dec 19 2014

Examples

			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]
where p = A084126(n) and q = A084127(n),
semiprimes marked with ** indicate terms of A138511, i.e. b = q + 1.
		

Crossrefs

Programs

  • 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
    
  • Scheme
    (define (A138510 n) (A251725 (A001358 n))) ;; Antti Karttunen, Dec 16 2014

Formula

a(n) = A251725(A001358(n)). - Antti Karttunen, Dec 16 2014

Extensions

Wrong comment corrected by Reinhard Zumkeller, Dec 16 2014

A261073 Semiprimes whose prime factors are of equal binary length and which differ from each other in one bit position only.

Original entry on oeis.org

6, 35, 323, 437, 713, 899, 1763, 1961, 2021, 2537, 3233, 4757, 5561, 5609, 6497, 7313, 9797, 10403, 10961, 11009, 18209, 19043, 21353, 22499, 23393, 26969, 27221, 29177, 37001, 38021, 39203, 45113, 71273, 72899, 79523, 87953, 95477, 98201, 99221, 106793, 114857, 114929, 123353
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			6 = 2*3 is present, as 2 in binary is "10" and 3 in binary is "11", so both have two (significant) bits and they differ only in one bit-position from each other.
35 = 5*7 is present, as 5 in binary is "101" and 7 in binary is "111", which both have three bits, differing only in the middle position from each other.
		

Crossrefs

Cf. also A261074, A261075.
Cf. A071697 (a subsequence).
Intersection of A085721 and A261077.

Programs

  • Mathematica
    Select[Range[10^6], And[Length@ # == 2, IntegerLength[#1, 2] == IntegerLength[#2, 2] & @@ #, Total@ BitXor[IntegerDigits[#1, 2], IntegerDigits[#2, 2]] == 1 & @@ #] &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger@ #] &] (* Michael De Vlieger, Oct 08 2016 *)
  • PARI
    A000523 = n -> logint(n, 2);
    A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));
    isA261073(n) = { my(a,b); if(bigomega(n)!=2, 0, a=A020639(n); b = (n/a); ((A000523(a) == A000523(b)) && (1 == norml2(binary(bitxor(a,b)))))); };
    i=0; n=0; while(i < 5000, n++; if(isA261073(n), i++; write("b261073.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261073 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (= (A000523 (A020639 n)) (A000523 (A006530 n))) (= 1 (A101080bi (A020639 n) (A006530 n)))))))

A261074 Semiprimes whose prime factors are of equal binary length and which differ from each other in exactly two bit positions.

Original entry on oeis.org

143, 391, 493, 589, 667, 1517, 1739, 1927, 2257, 2419, 2501, 2773, 2867, 3599, 4891, 5293, 5767, 5893, 6499, 6901, 7081, 7169, 7171, 7387, 7811, 7957, 8137, 8453, 8611, 9379, 9991, 10033, 10057, 10379, 10573, 11021, 11227, 11413, 11663, 13081, 13589, 13843, 17947, 19781, 21509, 21877, 22657, 23449, 23701, 23707, 25217, 25283, 26069, 26441, 27029
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			143 = 11*13 is included because 11 ("1011" in binary) and 13 ("1101" in binary) differ from each other in exactly two bit-positions.
56153 = 233 * 241 is included (as term a(119)) because 233 ("11101001" in binary) and 241 ("11110001" in binary) differ from each other in exactly two bit-positions.
		

Crossrefs

Cf. also A261073, A261075.
Subsequence of A085721.

Programs

  • Mathematica
    Select[Range[10^5], And[Length@ # == 2, IntegerLength[#1, 2] == IntegerLength[#2, 2] & @@ #, Total@ BitXor[IntegerDigits[#1, 2], IntegerDigits[#2, 2]] == 2 & @@ #] &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger@ #] &] (* Michael De Vlieger, Oct 08 2016 *)
  • PARI
    A000523 = n -> logint(n, 2);
    A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));
    isA261074(n) = { my(a,b); if(bigomega(n)!=2, 0, a = A020639(n); b = (n/a); ((A000523(a) == A000523(b)) && (2 == norml2(binary(bitxor(a,b)))))); };
    i=0; n=0; while(i < 10000, n++; if(isA261074(n), i++; write("b261074.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261074 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (= (A000523 (A020639 n)) (A000523 (A006530 n))) (= 2 (A101080bi (A020639 n) (A006530 n)))))))

A261075 Semiprimes whose prime factors are of equal binary length and which differ from each other in exactly three bit positions.

Original entry on oeis.org

527, 551, 1591, 2173, 2491, 2623, 3127, 5183, 5963, 6059, 6557, 6767, 6887, 7031, 7373, 7571, 7597, 7739, 7979, 8051, 8249, 8549, 8633, 8881, 9017, 9523, 9701, 10541, 10807, 11303, 11639, 12091, 12317, 12827, 14351, 19519, 20413, 20989, 21823, 22331, 23213, 24047, 24613, 24881, 24883, 25777, 25807, 26549, 26671, 26827, 26989, 27661, 28199, 28459, 28757, 29329
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			291311 = 523 * 557 is included (as term a(334)) because 523 ("1000001011" in binary) and 557 ("1000101101" in binary) differ in exactly three bit-positions.
		

Crossrefs

Cf. also A261073, A261074.
Subsequence of A085721.

Programs

  • Mathematica
    Select[Range@ 30000, And[Length@ # == 2, IntegerLength[#1, 2] == IntegerLength[#2, 2] & @@ #, Total@ BitXor[IntegerDigits[#1, 2], IntegerDigits[#2, 2]] == 3 & @@ #] &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger@ #] &] (* Michael De Vlieger, Oct 08 2016 *)
  • PARI
    A000523 = n -> logint(n, 2);
    A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));
    isA261075(n) = { my(a,b); if(bigomega(n)!=2, 0, a = A020639(n); b = (n/a); ((A000523(a) == A000523(b)) && (3 == norml2(binary(bitxor(a,b)))))); };
    i=0; n=0; while(i < 10000, n++; if(isA261075(n), i++; write("b261075.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261075 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (= (A000523 (A020639 n)) (A000523 (A006530 n))) (= 3 (A101080bi (A020639 n) (A006530 n)))))))

A266346 Numbers that can be represented as a product of two numbers with an equal number of significant digits (bits) in binary system.

Original entry on oeis.org

0, 1, 4, 6, 9, 16, 20, 24, 25, 28, 30, 35, 36, 42, 49, 64, 72, 80, 81, 88, 90, 96, 99, 100, 104, 108, 110, 112, 117, 120, 121, 126, 130, 132, 135, 140, 143, 144, 150, 154, 156, 165, 168, 169, 180, 182, 195, 196, 210, 225, 256, 272, 288, 289, 304, 306, 320, 323, 324, 336, 340, 342, 352, 357, 360, 361, 368, 374, 378, 380, 384, 391
Offset: 0

Views

Author

Antti Karttunen, Dec 28 2015

Keywords

Comments

Indexing starts from zero as a(0) = 0 is a special case in this sequence.

Examples

			1 can be represented as 1*1 (1 being "1" also in base-2 system), thus it is included.
4 can be represented as 2*2, and like any square, is included.
6 can be represented as 2*3, and both "10" and "11" require two bits in binary system, thus 6 is included.
		

Crossrefs

Positions of nonzeros in A266342.
Cf. A266347 (complement).
Cf. A000290, A085721, A261073, A261074, A261075 (subsequences).
Cf. also A266342.

Programs

  • Mathematica
    {0}~Join~Flatten[Position[#, k_ /; k > 0] &@ Table[Length@ DeleteCases[Flatten@ Map[Differences@ IntegerLength[#, 2] &, Transpose@ {#, n/#}] &@ TakeWhile[Divisors@ n, # <= Sqrt@ n &], k_ /; k > 0], {n, 400}]] (* Michael De Vlieger, Dec 30 2015 *)

A200878 Composite numbers whose prime factors have equal numbers of bits.

Original entry on oeis.org

4, 6, 8, 9, 12, 16, 18, 24, 25, 27, 32, 35, 36, 48, 49, 54, 64, 72, 81, 96, 108, 121, 125, 128, 143, 144, 162, 169, 175, 192, 216, 243, 245, 256, 288, 289, 323, 324, 343, 361, 384, 391, 432, 437, 486, 493, 512, 527, 529, 551, 576, 589, 625, 648, 667, 713
Offset: 1

Views

Author

Arkadiusz Wesolowski, Nov 23 2011

Keywords

Examples

			7429 = 17*19*23 -> 10001*10011*10111, therefore 7429 is a term.
7430 = 2*5*743 -> 10*101*1011100111, therefore 7430 is not a term.
		

Crossrefs

Supersequence of A085721 and of A182302.

Programs

  • Mathematica
    lst = {}; Do[b = IntegerDigits[FactorInteger[n], 2]; If[! PrimeQ[n] && Length[b[[-1, 1]]] == Length[b[[1, 1]]], AppendTo[lst, n]], {n, 4, 6!}]; lst (* Arkadiusz Wesolowski, Dec 03 2011 *)
    Select[Range[800],CompositeQ[#]&&Length[Union[IntegerLength[ #,2]&/@ FactorInteger[ #][[All,1]]]]==1&] (* Harvey P. Dale, Oct 11 2021 *)
  • PARI
    is(n)=my(f=factor(n)[,1]);#binary(f[1])==#binary(f[#f])&&!isprime(n) \\ Charles R Greathouse IV, Dec 23 2011
Showing 1-7 of 7 results.