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.

Previous Showing 41-50 of 853 results. Next

A232235 Primes that can be written in binary representation as concatenation of two primes: p and p-2. That is, primes representable as p * 2^L + p-2, where p and p-2 are primes, and L is the length of binary representation of p-2: L = A070939(p-2).

Original entry on oeis.org

23, 61, 1021, 139021, 145177, 222127, 2645257, 2706727, 2928019, 3050959, 3997597, 38695537, 45086077, 49903561, 50247667, 53688727, 56294101, 545636617, 556450387, 558023299, 563331877, 563921719, 581616979, 582993277, 607570027, 619956709, 638045197, 660262579
Offset: 1

Views

Author

Alex Ratushnyak, Nov 20 2013

Keywords

Comments

A subsequence of A232085.

Crossrefs

Formula

a(n) = A232237(n) * 2^A070939(A232237(n)-2) + A232237(n)-2.

A232236 Primes that can be written in binary representation as concatenation of two primes: p and p+2. That is, primes representable as p * 2^L + p+2, where p and p+2 are primes, and L is the length of binary representation of p+2: L = A070939(p+2).

Original entry on oeis.org

29, 47, 563, 9161, 137999, 2149403, 2358401, 3526331, 41776109, 43250849, 46347803, 51607709, 53819819, 55540349, 59866253, 62176679, 539082821, 545571083, 546947381, 625199753, 627165893, 629525261, 650169731, 654102011, 680644901, 687526391, 688509461, 690082373
Offset: 1

Views

Author

Alex Ratushnyak, Nov 20 2013

Keywords

Comments

A subsequence of A232085.

Crossrefs

Formula

a(n) = A232238(n) * 2^A070939(A232238(n)+2) + A232238(n)+2.

A232239 Lesser of twin-bin primes: primes p such that p+2, x and y are primes, where x is concatenation of binary representations of p and p+2, and y is concatenation of binary representations of p+2 and p: x = p * 2^A070939(p+2) + p+2, y = (p+2) * 2^A070939(p) + p.

Original entry on oeis.org

3, 5, 269, 16649, 27689, 29129, 82889, 93239, 129629, 274199, 289169, 309479, 336899, 349079, 371339, 374639, 415109, 454709, 463889, 492719, 1051079, 1063919, 1127309, 1198289, 1209779, 1229519, 1268789, 1350959, 1354649, 1355279, 1392539, 1430879, 1547129, 1551959
Offset: 1

Views

Author

Alex Ratushnyak, Nov 20 2013

Keywords

Comments

Conjecture: the sequence is infinite.

Examples

			269 is in the sequence because the following are three primes: 271, 269 * 512 + 271 = 137999, 271 * 512 + 269 = 139021.
		

Crossrefs

Programs

  • Java
    import java.math.BigInteger;
    public class A232239 {
    public static void main (String[] args) {
    long bl = 2, next = 3; // bit length, next n such that bl++ for n + 2
    for (long n = 3; n < 0xffffffffL; n += 2) {
      long blPrev = bl;
      if (n == next) { ++bl; next = next * 2 + 1; }
      if (BigInteger.valueOf(n).isProbablePrime(80) &&
        BigInteger.valueOf(n + 2).isProbablePrime(80) &&
        BigInteger.valueOf((n << bl) + n + 2).isProbablePrime(80) &&
        BigInteger.valueOf(((n + 2) << blPrev) + n).isProbablePrime(80))
            System.out.printf("%d, ", n);
    }
    }
    }
  • Mathematica
    Select[Prime[Range[200]], PrimeQ[# + 2] && PrimeQ[FromDigits[Flatten[{IntegerDigits[#, 2], IntegerDigits[# + 2, 2]}], 2]] && PrimeQ[FromDigits[Flatten[{IntegerDigits[# + 2, 2], IntegerDigits[#, 2]}], 2]] &] (* Alonso del Arte, Jan 19 2014 *)

A264749 a(n) = floor(n/BL(n)) where BL(n) = A070939(n) is the binary length of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12
Offset: 0

Views

Author

Alex Ratushnyak, Nov 23 2015

Keywords

Crossrefs

Programs

  • Haskell
    a264749 n = div n $ a070939 n  -- Reinhard Zumkeller, Dec 05 2015
  • Mathematica
    {0}~Join~Table[Floor[n/IntegerLength[n, 2]], {n, 84}] (* Michael De Vlieger, Dec 01 2015 *)
  • PARI
    a(n) = if (n, n\#binary(n)); \\ Michel Marcus, Dec 01 2015
    
  • Python
    for n in range(88):  print(n // (len(bin(n))-2), end=', ')
    

A318687 Number of length-n circular binary words having exactly n distinct blocks of length floor(log_2(n)) + 1 (A070939).

Original entry on oeis.org

2, 1, 2, 3, 2, 3, 4, 12, 14, 17, 14, 13, 12, 20, 32, 406, 538, 703, 842, 1085, 1310, 1465, 1544, 1570, 1968, 2132, 2000, 2480, 2176, 2816, 4096, 1060280
Offset: 1

Views

Author

Jeffrey Shallit, Aug 31 2018

Keywords

Comments

A "circular word" (a.k.a. "necklace") is one that wraps around from the end to the beginning. The words are counted up to an equivalence where two circular words are the same if one is a cyclic shift of the other.

Crossrefs

Cf. A317586, which studies a similar quantity for two different lengths of blocks.
Cf. A070939.

Formula

a(2^n-1) = 2^(2^(n-1)-n+1) since A317586(2^n) = 2^(2^(n-1)-n) and A317586(2^n-1) = A317586(2^n+1) = 2*A317586(2^n) = 2^(2^(n-1)-n+1). - Altug Alkan, Sep 05 2018

A320675 Positive integers m with binary expansion (b_1, ..., b_k) (where k = A070939(m)) such that b_i = [gcd(m, i)=1] for i = 1..k (where [] is an Iverson bracket).

Original entry on oeis.org

1, 2, 3, 7, 10, 20, 27, 31, 40, 127, 138, 219, 245, 276, 552, 650, 682, 1364, 2047, 2728, 8191, 10922, 13515, 14043, 32747, 112347, 131071, 524287, 2796202, 3459945, 5592404, 7124187, 8388607, 8530050, 10660010, 11184808, 16645111, 17060100, 21320020, 33554431
Offset: 1

Views

Author

Rémy Sigrist, Oct 19 2018

Keywords

Comments

In other words, the ones in the binary representation of a term of this sequence encode the first numbers coprime to this term.
This sequence contains every term of A001348: 2^2 - 1 belongs to this sequence, and for any odd prime number p, if q divides 2^p - 1, then q > p and gcd(p, i) = 1 for i = 1..p.
See A320673 for similar sequences.

Examples

			The first terms, alongside their binary representation and the coprime numbers encoded therein, are:
  n   a(n)  bin(a(n))  First numbers coprime
  --  ----  ---------  ---------------------
   1     1  1          1
   2     2  10         1
   3     3  11         1, 2
   4     7  111        1, 2, 3
   5    10  1010       1, 3
   6    20  10100      1, 3
   7    27  11011      1, 2, 4, 5
   8    31  11111      1, 2, 3, 4, 5
   9    40  101000     1, 3
  10   127  1111111    1, 2, 3, 4, 5, 6, 7
		

Crossrefs

Programs

  • PARI
    is(n) = my (b=binary(n)); b==vector(#b, k, gcd(n, k)==1)

A324391 Fully multiplicative with a(p^e) = A070939(p)^e, where A070939(p) gives the length of the binary representation of p.

Original entry on oeis.org

1, 2, 2, 4, 3, 4, 3, 8, 4, 6, 4, 8, 4, 6, 6, 16, 5, 8, 5, 12, 6, 8, 5, 16, 9, 8, 8, 12, 5, 12, 5, 32, 8, 10, 9, 16, 6, 10, 8, 24, 6, 12, 6, 16, 12, 10, 6, 32, 9, 18, 10, 16, 6, 16, 12, 24, 10, 10, 6, 24, 6, 10, 12, 64, 12, 16, 7, 20, 10, 18, 7, 32, 7, 12, 18, 20, 12, 16, 7, 48, 16, 12, 7, 24, 15, 12, 10, 32, 7, 24, 12, 20, 10, 12
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2019

Keywords

Crossrefs

Programs

  • PARI
    A070939(n) = if(!n,1,#binary(n));
    A324391(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = A070939(f[i, 1])); factorback(f); };

Formula

For all n >= 1, a(A000668(n)) = A000043(n).

A365746 Table read by antidiagonals upward: T(n,k) is the number of binary strings of length k with the property that every substring of length A070939(n) is lexicographically earlier than the binary expansion of n; n, k >= 0.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 4, 5, 2, 1, 0, 1, 2, 4, 4, 8, 2, 1, 0, 1, 2, 4, 5, 4, 13, 2, 1, 0, 1, 2, 4, 6, 7, 4, 21, 2, 1, 0, 1, 2, 4, 7, 10, 11, 4, 34, 2, 1, 0, 1, 2, 4, 8, 13, 16, 16, 4, 55, 2, 1, 0, 1, 2, 4, 8, 8, 24
Offset: 0

Views

Author

Peter Kagey, Sep 17 2023

Keywords

Examples

			Table begins:
 n\k | 0  1  2  3   4   5   6   7    8    9   10   11
-----+----------------------------------------------------
   0 | 1, 0, 0, 0,  0,  0,  0,  0,   0,   0,   0,   0, ...
   1 | 1, 1, 1, 1,  1,  1,  1,  1,   1,   1,   1,   1, ...
   2 | 1, 2, 2, 2,  2,  2,  2,  2,   2,   2,   2,   2, ...
   3 | 1, 2, 3, 5,  8, 13, 21, 34,  55,  89, 144, 233, ...
   4 | 1, 2, 4, 4,  4,  4,  4,  4,   4,   4,   4,   4, ...
   5 | 1, 2, 4, 5,  7, 11, 16, 23,  34,  50,  73, 107, ...
   6 | 1, 2, 4, 6, 10, 16, 26, 42,  68, 110, 178, 288, ...
   7 | 1, 2, 4, 7, 13, 24, 44, 81, 149, 274, 504, 927, ...
   8 | 1, 2, 4, 8,  8,  8,  8,  8,   8,   8,   8,   8, ...
   9 | 1, 2, 4, 8,  9, 11, 15, 23,  32,  43,  58,  81, ...
For (n,k) = (3,4), we see that T(3,4) = 8 because there are 8 binary strings of length k = 4 where all length A070939(3) = 2 substrings are lexicographically earlier than "11" (the binary expansion of n = 3): 0000, 0001, 0010, 0100, 0101, 1000, 1001, and 1010.
		

Crossrefs

Cf. A000045 (row 3), A164316 (row 5), A128588 (row 6), A000073 (row 7).

Programs

  • Mathematica
    A365746Row[s_,
      numberOfTerms_] := (digits = If[s == 0, 1, Ceiling[Log[2, s + 1]]];
      m = 2^(digits - 1);
      transferMatrix =
       If[s == 0, {{0}},
        Table[If[(Ceiling[i/2] ==
             j) || ((i <= s - m) && (Ceiling[i/2] == j - m/2)), 1, 0], {i,
           1, m}, {j, 1, m}]];
      sequence =
       Table[2^k, {k, 0, digits - 1}] ~Join~
        Table[MatrixPower[transferMatrix, k] // Total // Total, {k, 1,
          numberOfTerms - digits}];
      Take[sequence, numberOfTerms])

Formula

G.f. for row n = 0: 1;
G.f. for row n = 1: 1/(1 - x);
G.f. for row n = 2: (1 + x)/(1 - x);
G.f. for row n = 3: (1 + x)/(1 - x - x^2);
G.f. for row n = 4: (1 + x + 2x^2)/(1 - x);
G.f. for row n = 5: (1 + x + 2x^2)/(1 - x - x^3);
G.f. for row n = 6: (1 + x + x^2)/(1 - x - x^2);
G.f. for row n = 7: (1 + x + x^2)/(1 - x - x^2 - x^3);
G.f. for row n = 8: (1 + x + 2 x^2 + 4 x^3)/(1 - x);
G.f. for row n = 9: (1 + x + 2x^2 + 4x^3)/(1 - x - x^4).

A371343 Lexicographically latest sequence of distinct nonnegative integers such that for any n >= 0, the binary expansions of n and of a(n) have the same length (A070939) and the same number of runs of consecutive equals digits (A005811).

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 4, 7, 14, 13, 10, 11, 12, 9, 8, 15, 30, 29, 26, 27, 22, 21, 20, 25, 28, 23, 18, 19, 24, 17, 16, 31, 62, 61, 58, 59, 54, 53, 52, 57, 50, 45, 42, 43, 46, 41, 44, 55, 60, 51, 40, 49, 38, 37, 36, 47, 56, 39, 34, 35, 48, 33, 32, 63, 126, 125, 122
Offset: 0

Views

Author

Rémy Sigrist, Mar 24 2024

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers with infinitely many fixed points (for example, all terms of A000225 are fixed points).

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0
   1     1       1          1
   2     2      10         10
   3     3      11         11
   4     6     100        110
   5     5     101        101
   6     4     110        100
   7     7     111        111
   8    14    1000       1110
   9    13    1001       1101
  10    10    1010       1010
  11    11    1011       1011
  12    12    1100       1100
  13     9    1101       1001
  14     8    1110       1000
  15    15    1111       1111
		

Crossrefs

See A331274 and A337242 for similar sequences.

Programs

  • PARI
    \\ See Links section.

A380294 The Golomb-Rice encoding of n, with M = A070939(A070939(n)).

Original entry on oeis.org

1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 48, 49, 50, 51, 52, 53, 54, 55, 112, 113, 114, 115, 116, 117, 118, 119, 240, 241, 242, 243, 244, 245, 246, 247, 496, 497, 498, 499, 500, 501, 502, 503, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 2032
Offset: 1

Views

Author

Darío Clavijo, Jan 19 2025

Keywords

Comments

For n <= 3 leading zeros are omitted.
In the original Golomb-Rice algorithm, M is an arbitrary power of 2. Here, M is determined as 2^(floor(log_2(floor(log_2(n))+1))+1).
a(2^k) is a divisor of a(2^(k+1)).

Examples

			For n = 42 a(42) = 111110010_2 = 498.
m = 2^(floor(log_2(floor(log_2(n))+1))+1) = 8 and
q = floor(n / m) = 5 and
r = n mod m = 2 and
u = (2^q-1) left shifted by (2^floor(log_2(m)) + 1) = 111110000_2 = 496 and
u + r = 111110010_2 = 498.
		

Crossrefs

Programs

  • Mathematica
    A380294[n_] := (2^Quotient[n, #] - 1)*2^BitLength[#] + Mod[n, #] & [2^Nest[BitLength, n, 2]];
    Array[A380294, 100] (* Paolo Xausa, Feb 03 2025 *)
  • Python
    def a(n):
        if n <= 3: return n
        if n & 1: return a(n-1)+1
        m = 1 << (n.bit_length()).bit_length()
        q, r = divmod(n, m)
        u = ((1 << q) - 1) << m.bit_length()
        return u + r
    print([a(n) for n in range(1,57)])

Formula

a(n) = (2^q - 1) * 2^A070939(m) + r, where m = 2^A070939(A070939(n)), q = floor(n/m) and r = n mod m.
a(n) = a(n-1)+1 for n odd > 1.
a(n) = n if n <= 3.
Previous Showing 41-50 of 853 results. Next