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 21-30 of 198 results. Next

A330340 a(n) is the least k such that A092213(n) = k + reverse(k) (where reverse(k) is the binary reverse of k, A030101(k)).

Original entry on oeis.org

0, 1, 2, 4, 3, 6, 5, 7, 10, 16, 9, 14, 11, 20, 18, 15, 32, 17, 22, 26, 21, 19, 30, 34, 23, 27, 44, 31, 38, 64, 33, 50, 46, 37, 54, 35, 68, 45, 62, 39, 66, 76, 51, 84, 47, 55, 74, 70, 92, 63, 128, 65, 98, 78, 86, 73, 106, 69, 102, 94, 67, 132, 77, 110, 85, 118
Offset: 0

Views

Author

Rémy Sigrist, Jan 21 2020

Keywords

Examples

			For n = 3:
- A092213(3) = 5,
- 4 is the least k such that k + reverse(k) = 5,
- so a(3) = 4.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) + A030101(a(n)) = A092213(n).
a(n) <= A331585(n).

A331585 a(n) is the greatest k such that A092213(n) = k + reverse(k) (where reverse(k) is the binary reverse of k, A030101(k)).

Original entry on oeis.org

0, 1, 2, 4, 3, 8, 5, 7, 12, 16, 9, 14, 13, 20, 24, 15, 32, 17, 28, 26, 21, 25, 40, 48, 29, 27, 44, 31, 56, 64, 33, 50, 60, 41, 72, 49, 80, 45, 62, 57, 96, 88, 51, 84, 61, 59, 104, 112, 92, 63, 128, 65, 98, 120, 116, 73, 106, 81, 144, 124, 97, 160, 89, 122, 85
Offset: 0

Views

Author

Rémy Sigrist, Jan 21 2020

Keywords

Examples

			For n = 5:
- A092213(5) = 9,
- 8 is the greatest k such that k + reverse(k) = 9,
- so a(5) = 8.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) + A030101(a(n)) = A092213(n).
a(n) >= A330340(n).

A339570 Denote the van der Corput sequence of fractions 1/2, 1/4, 3/4, 1/8, 5/8, 3/8, 7/8, 1/16, ... (A030101/A062383) by v(n), n >= 1. Then a(n) = denominator of v(A014486(n)).

Original entry on oeis.org

4, 16, 16, 64, 64, 64, 64, 64, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024
Offset: 1

Views

Author

N. J. A. Sloane, Dec 09 2020

Keywords

Comments

Comment from N. J. A. Sloane, Dec 11 2020: (Start)
The initial values suggest the conjecture that this sequence consists exactly of Catalan(k) copies of 4^k for k >= 1.
Hugo Pfoertner tested this conjecture with the PARI program given below.
Here is the output from that program:
[1, 0, 4]
[2, 4, 16]
[4, 16, 64]
[9, 64, 256]
[23, 256, 1024]
[65, 1024, 4096]
[197, 4096, 16384]
[626, 16384, 65536]
[2056, 65536, 262144]
[6918, 262144, 1048576]
[23714, 1048576, 4194304]
The first column is A014137, the partial sums of the Catalan numbers, which is strong support for the conjecture.
The conjecture has now been proved by Raghavendra Tripathi - see link. (End)

Examples

			The van der Corput sequence v(n), n >= 1, is 1/2, 1/4, 3/4, 1/8, 5/8, 3/8, 7/8, 1/16, 9/16, 5/16, 13/16, 3/16, 11/16, ... = A030101/A062383.
Then we construct the sequence b(n) = v(A014486(n)), n >= 1, which is 1/4, 5/16, 3/16, 21/64, 13/64, 19/64, 11/64, 7/64, ...
a(n) is the denominator of b(n), and A072800(n) is the numerator.
		

Crossrefs

Programs

  • PARI
    \\ Program from Hugo Pfoertner for studying the connection with the Catalan numbers mentioned in the Comments.
    a30101(n)=fromdigits(Vecrev(binary(n)), 2);
    a62383(n)=1<<(log(2*n+1)\log(2));
    is_a14486(n)={my(v=binary(n), t=0); for(i=1, #v, t+=if(v[i], 1, -1); if(t<0, return(0))); t==0};
    A14486=[];for(k=1,5000000,if(is_a14486(k),A14486=concat(A14486,k)));
    aprev=0;for(k=1,#A14486,my(j=A14486[k],a=denominator(a30101(j)/a62383(j)));if(a!=aprev,print([k,aprev,a]);aprev=a));

Extensions

More terms from Hugo Pfoertner, Dec 09 2020

A175045 a(n) = number of distinct values k of substrings in binary n where both k is prime and A030101(k) is prime.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 2, 0, 0, 1, 3, 1, 3, 2, 2, 0, 1, 0, 1, 1, 1, 3, 5, 1, 1, 3, 4, 2, 5, 2, 3, 0, 0, 1, 2, 0, 2, 1, 2, 1, 2, 1, 4, 3, 4, 5, 6, 1, 2, 1, 1, 3, 4, 4, 6, 2, 2, 5, 6, 2, 6, 3, 3, 0, 0, 0, 2, 1, 2, 2, 4, 0, 1, 2, 4, 1, 3, 2, 2, 1, 2, 2, 4, 1, 1, 4, 6, 3, 3, 4, 4, 5, 7, 6, 7, 1, 2, 2, 2, 1, 4, 1, 2, 3
Offset: 0

Views

Author

Leroy Quet, Dec 02 2009

Keywords

Comments

A030101(m) is the decimal value of {m written in binary and then the digits reversed}.

Examples

			23 in binary is 10111. Looking at the distinct values of substrings: 0, 0 in decimal, is not a prime. 1, 1 in decimal, is not a prime. 10 = 2 in decimal, is a prime, but its reversal is 1, which is not a prime. 11 is 3 in decimal, which is prime; and its reversal, 11, is prime in decimal too. 101 is 5 in decimal, a prime; and its reversal, 101, is prime in decimal too. 111 is 7 in decimal, a prime, and its reversal is 7, which is also a prime. 1011 is 11 in decimal, which is prime, and its reversal, 1101, is 13, which is also a prime. And 10111 itself is 23 in decimal, a prime, and its reversal is 11101, which is 29 in decimal, also a prime. There are therefore 5 values of substrings that are prime and their binary digit reversals are prime, so a(23) = 5.
10010 is 18 in decimal. Note that "010" is a substring with a decimal value of 2, and the reversal of this substring is also 2. However, this substring does not count towards the substrings being enumerated because we first take the value k of the substring, then take A030101(k) to see if both are prime. And A030101(2) = 1, not 2.
		

Crossrefs

Extensions

Extended by Ray Chandler, Dec 18 2009

A175392 a(n) is the smallest positive integer that, when written in binary, occurs in binary A154809(n) but not in binary A030101(A154809(n)).

Original entry on oeis.org

2, 2, 2, 2, 10, 11, 2, 6, 2, 2, 18, 19, 4, 11, 11, 2, 6, 6, 2, 6, 2, 2, 34, 35, 18, 18, 19, 19, 4, 10, 42, 11, 4, 11, 11, 2, 6, 6, 4, 6, 22, 23, 2, 6, 6, 14, 2, 6, 2, 2, 66, 67, 34, 34, 35, 35, 8, 18, 11, 19, 13, 19, 19, 4, 10, 10, 10, 4, 11, 11, 4, 11, 10, 91
Offset: 1

Views

Author

Leroy Quet, Apr 28 2010

Keywords

Comments

A154809(n) is the n-th positive integer that is not a palindrome when written in binary.
A030101(n) is the decimal value of the digits of binary n written in backwards order.
No substring in binary n is absent from binary A030101(n) if n is a palindrome when written in binary.
It is immaterial if the leading 0's are included as part of A030101(A154809(n)) when checking if a particular substring is part of it, because the binary representations of all substrings begin with 1.

Examples

			20 in binary is 10100. A030101(20) = 5, which is 00101 = 101 in binary. The positive integers that occur as substrings of 10100 when written in binary are 1 (1 in binary), 2 (10 in binary), 4 (100 in binary), 5 (101 in binary), 10 (1010 in binary), and 20 (10100 in binary). The binary substring with the largest decimal value not present in (00)101 is 100, which is 4 in decimal. So a(20) = 4.
		

Crossrefs

Programs

  • PARI
    in(abc, b) = my (m=2^#binary(b)); while (abc >= b, if (abc%m==b, return (1), abc\=2)); return (0)
    for (v=1, 91, my (w=fromdigits(Vecrev(binary(v)),2)); if (v!=w, for (k=1, oo, if (in(v,k) && !in(w,k), print1 (k ", "); break)))) \\ Rémy Sigrist, Nov 08 2018

Extensions

More terms from Rémy Sigrist, Nov 08 2018

A175917 Convert n to binary. NOR each respective digit of binary n and binary A030101(n), where A030101(n) is the reversal of the order of the digits in the binary representation of n (given in decimal). a(n) is the decimal value of the result.

Original entry on oeis.org

0, 0, 0, 0, 2, 2, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 14, 14, 4, 4, 10, 10, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 30, 30, 12, 12, 18, 18, 0, 0, 18, 18, 0, 0, 18, 18, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 28, 28, 42, 42, 8, 8, 54, 54, 20, 20, 34, 34, 0, 0, 42, 42, 8, 8, 42, 42, 8, 8, 34
Offset: 0

Views

Author

Dylan Hamilton, Oct 15 2010

Keywords

Comments

Description format taken from Leroy Quet's OR and AND gate sequences for consistency.

Crossrefs

Or A175298 and And A175297 gate sequences. The rest of the equivalent sequences for other gates are adjacent.

Programs

  • Mathematica
    Table[f = IntegerDigits[x, 2]; f = f + Reverse[f]; FromDigits[ Table[If[Positive[f[[r]]], 0, 1], {r, 1, Length[f]}], 2], {x, STARTPOINT,ENDPOINT}]

A175918 Convert n to binary. NAND each respective digit of binary n and binary A030101(n), where A030101(n) is the reversal of the order of the digits in the binary representation of n (given in decimal). a(n) is the decimal value of the result.

Original entry on oeis.org

0, 0, 3, 0, 7, 2, 5, 0, 15, 6, 15, 6, 15, 6, 9, 0, 31, 14, 31, 14, 27, 10, 27, 10, 31, 14, 21, 4, 27, 10, 17, 0, 63, 30, 63, 30, 63, 30, 63, 30, 63, 30, 63, 30, 51, 18, 51, 18, 63, 30, 45, 12, 63, 30, 45, 12, 63, 30, 45, 12, 51, 18, 33, 0, 127, 62, 127, 62, 127, 62, 127, 62, 119, 54, 119
Offset: 0

Views

Author

Dylan Hamilton, Oct 15 2010

Keywords

Comments

Description format taken from Leroy Quet's OR and AND gate sequences for consistency.

Crossrefs

Or A175298 and And A175297 gate sequences. The rest of the equivalent sequences for other gates are adjacent.

Programs

  • Mathematica
    Table[f = IntegerDigits[x, 2]; f = f + Reverse[f]; FromDigits[ Table[If[f[[r]] < 2, 1, 0], {r, 1, Length[f]}], 2], {x, STARTPOINT,ENDPOINT}]

A175920 Convert n to binary. XNOR each respective digit of binary n and binary A030101(n), where A030101(n) is the reversal of the order of the digits in the binary representation of n (given in decimal). a(n) is the decimal value of the result.

Original entry on oeis.org

0, 1, 0, 3, 2, 7, 2, 7, 6, 15, 0, 9, 0, 9, 6, 15, 14, 31, 4, 21, 14, 31, 4, 21, 4, 21, 14, 31, 4, 21, 14, 31, 30, 63, 12, 45, 18, 51, 0, 33, 18, 51, 0, 33, 30, 63, 12, 45, 12, 45, 30, 63, 0, 33, 18, 51, 0, 33, 18, 51, 12, 45, 30, 63, 62, 127, 28, 93, 42, 107, 8, 73, 62, 127, 28, 93, 42
Offset: 0

Views

Author

Dylan Hamilton, Oct 15 2010

Keywords

Comments

Description format taken from Leroy Quet's OR and AND gate sequences for consistency.

Crossrefs

Or A175298 and And A175297 gate sequences. The rest of the equivalent sequences for other gates are adjacent.

Programs

  • Mathematica
    Table[f = IntegerDigits[x, 2]; f = f + Reverse[f]; FromDigits[ Table[If[EvenQ[f[[r]]], 1, 0], {r, 1, Length[f]}], 2], {x, STARTPOINT,ENDPOINT}]

A239447 Partial sums of A030101.

Original entry on oeis.org

0, 1, 2, 5, 6, 11, 14, 21, 22, 31, 36, 49, 52, 63, 70, 85, 86, 103, 112, 137, 142, 163, 176, 205, 208, 227, 238, 265, 272, 295, 310, 341, 342, 375, 392, 441, 450, 491, 516, 573, 578, 615, 636, 689, 702, 747, 776, 837, 840, 875, 894, 945, 956, 999, 1026, 1085
Offset: 0

Views

Author

Olivier Pirson, Mar 18 2014

Keywords

Crossrefs

Cf. A030101.

Programs

  • Mathematica
    Accumulate[Table[FromDigits[Reverse[IntegerDigits[n,2]],2],{n,0,80}]] (* Harvey P. Dale, Jan 10 2023 *)
  • Python
    A = {0: 0, 1: 1, 2: 2, 3: 5}
    def a(n):
        a_n = A.get(n)
        if a_n is not None:
            return a_n
        q, r = divmod(n, 4)
        if r == 0:
            a_n = a(q*2)*6 - a(q)*5 - a(q - 1)*3 - 1
        elif r == 1:
            a_n = a(q*2 + 1)*2 + a(q*2)*4 - a(q)*6 - a(q - 1)*2 - 1
        elif r == 2:
            a_n = a(q*2 + 1)*3 + a(q*2)*3 - a(q)*6 - a(q - 1)*2 - 1
        else:
            a_n = a(q*2 + 1)*6 - a(q)*8 - 1
        A[n] = a_n  # memoization
        return a_n

Formula

a(4n) = 6 a(2n) - 5 a(n) - 3 a(n-1) - 1.
a(4n + 1) = 2 a(2n+1) + 4 a(2n) - 6 a(n) - 2 a(n-1) - 1.
a(4n + 2) = 3 a(2n+1) + 3 a(2n) - 6 a(n) - 2 a(n-1) - 1.
a(4n + 3) = 6 a(2n+1) - 8 a(n) - 1.

Extensions

More terms from Alois P. Heinz, May 19 2014

A326302 a(n) = lcm(n, r(n)) where r(n) = A030101(n) corresponds to the binary reversal of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 143, 12, 143, 14, 15, 16, 17, 18, 475, 20, 21, 286, 667, 24, 475, 286, 27, 28, 667, 30, 31, 32, 33, 34, 245, 36, 1517, 950, 741, 40, 1517, 42, 2279, 572, 45, 1334, 2867, 48, 245, 950, 51, 572, 2279, 54, 3245, 56, 741, 1334, 3245
Offset: 0

Views

Author

Rémy Sigrist, Oct 17 2019

Keywords

Examples

			For n = 35:
- the binary reversal of 35 ("100011" in binary) is 49 ("110001" in binary),
- hence a(35) = lcm(35, 49) = lcm(5*7, 7^2) = 5*7^2 = 245.
		

Crossrefs

Cf. A030101, A057890 (fixed points), A161825 (GCD variant), A068634 (decimal variant).
Cf. A062383.

Programs

  • Maple
    f:= proc(n) local L,j;
      L:= convert(n,base,2);
      ilcm(n, add(2^(j-1)*L[-j],j=1..nops(L)))
    end proc:
    map(f, [$0..100]);
  • PARI
    a(n, base=2) = lcm(n, fromdigits(Vecrev(digits(n, base)), base))

Formula

a(n) >= n with equality iff n belongs to A057890.
a(n) < A062383(n)*n. - Robert Israel, Oct 17 2019
Previous Showing 21-30 of 198 results. Next