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 11-14 of 14 results.

A306607 The bottom entry in the difference table of the binary digits of n.

Original entry on oeis.org

0, 1, 1, 0, 1, 2, -1, 0, 1, 0, 4, 3, -2, -3, 1, 0, 1, 2, -3, -2, 7, 8, 3, 4, -3, -2, -7, -6, 3, 4, -1, 0, 1, 0, 6, 5, -9, -10, -4, -5, 11, 10, 16, 15, 1, 0, 6, 5, -4, -5, 1, 0, -14, -15, -9, -10, 6, 5, 11, 10, -4, -5, 1, 0, 1, 2, -5, -4, 16, 17, 10, 11, -19
Offset: 0

Views

Author

Rémy Sigrist, Feb 28 2019

Keywords

Comments

By convention, a(0) = 0.
For any n > 0: let (b_0, ..., b_w) be the binary representation of n:
- b_w = 1, and for any k = 0..w, 0 <= b_k <= 1,
- n = Sum_{k = 0..w} b_k * 2^k,
- a(n) is the unique value remaining after taking successively the first differences of (b_0, ..., b_w) w times.
From Robert Israel, Mar 07 2019: (Start)
If n is odd then f(A030101(n)) = (-1)^A000523(n)*f(n).
In particular, if n is in A048701 then a(n)=0.
a(n) == 1 (mod A014963(A000523(n))) if n is even,
a(n) == 0 (mod A014963(A000523(n))) if n is odd. (End)

Examples

			For n = 42:
- the binary representation of 42 is "101010",
- the corresponding difference table is:
   0   1   0   1   0   1
     1  -1   1  -1   1
      -2   2  -2   2
         4  -4   4
          -8   8
            16
- hence a(42) = 16.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L;
      L:= convert(n,base,2);
      while nops(L) > 1 do
        L:= L[2..-1]-L[1..-2]
      od;
      op(L)
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 07 2019
  • Mathematica
    a[n_] := NestWhile[Differences, Reverse[IntegerDigits[n, 2]], Length[#] > 1 &][[1]]; Array[a, 100, 0] (* Amiram Eldar, Mar 08 2019 *)
  • PARI
    a(n) = if (n, my (v=Vecrev(binary(n))); while (#v>1, v=vector(#v-1, k, (v[k+1]-v[k]))); v[1], 0)
    
  • PARI
    a(n) = my(b = binary(n), s = -1); sum(i = 1, #b, s=-s; binomial(#b-1, i-1) * b[i] * s) \\ David A. Corneth, Mar 07 2019

Formula

a(2^k) = 1 for any k >= 0.
a(2^k-1) = 0 for any k > 1.
a(3*2^k) = -k for any k >= 0.
a(n) = Sum_{k=0..A000523(n)} binomial(A000523(n), k)*(-1)^k*A030302(n,k). - David A. Corneth, Mar 07 2019
G.f.: 1/(x-1)*Sum_{k>=0}(x^(2^(k+1))-x^(2^k) + x^(2^k)/(x^(2^k)+1)*Sum_{m>=k+1}(binomial(m,k)*(-1)^(m-k)*(x^(2^(m+1))-x^(2^m)))). - Robert Israel, Mar 07 2019

A342036 Palindromes of even length only using 0 or 1.

Original entry on oeis.org

0, 11, 1001, 1111, 100001, 101101, 110011, 111111, 10000001, 10011001, 10100101, 10111101, 11000011, 11011011, 11100111, 11111111, 1000000001, 1000110001, 1001001001, 1001111001, 1010000101, 1010110101, 1011001101, 1011111101, 1100000011, 1100110011
Offset: 0

Views

Author

Seiichi Manyama, Feb 26 2021

Keywords

Comments

Subsequence of A057148.
a(n) is a multiple of 11.

Examples

			A006995|A057148|A048701|A342036|A048700|A342040
-------+-------+-------+-------+-------+-------
     0 |     0 |     0 |     0 |       |
     1 |     1 |       |       |     1 |     1
     3 |    11 |     3 |    11 |       |
     5 |   101 |       |       |     5 |   101
     7 |   111 |       |       |     7 |   111
     9 |  1001 |     9 |  1001 |       |
    15 |  1111 |    15 |  1111 |       |
    17 | 10001 |       |       |    17 | 10001
		

Crossrefs

Programs

  • Mathematica
    Array[FromDigits@ Join[#, Reverse[#]] &@ IntegerDigits[#, 2] &, 26, 0] (* Michael De Vlieger, Feb 26 2021 *)
  • Python
    def a(n): b = bin(n)[2:]; return int(b+b[::-1])
    print([a(n) for n in range(27)]) # Michael S. Branicky, Feb 26 2021
  • Ruby
    def A(n)
      str = n.to_s(2)
      (str + str.reverse).to_i
    end
    def A342036(n)
      (0..n).map{|i| A(i)}
    end
    p A342036(30)
    

Formula

a(n) = A007088(n) * 10^A070939(n) + A305989(n).
a(n) = A007088(A048701(n)). - Michel Marcus, Feb 26 2021

Extensions

Offset changed to 0 by Andrey Zabolotskiy, Dec 26 2022

A306740 Numbers k such that A306607(k) = 0.

Original entry on oeis.org

0, 3, 7, 9, 15, 31, 33, 45, 51, 63, 127, 129, 153, 165, 189, 195, 219, 231, 255, 411, 435, 511, 513, 561, 585, 633, 645, 693, 717, 765, 771, 819, 843, 891, 903, 951, 975, 1023, 2047, 2049, 2145, 2193, 2289, 2313, 2409, 2457, 2553, 2565, 2661, 2709, 2805, 2829, 2925, 2973, 3069, 3075, 3171, 3219
Offset: 1

Views

Author

Robert Israel, Mar 07 2019

Keywords

Comments

The first even terms are 0, 68690167808, 68690561024, 68690757632, 68691150848, 68698560512, 68698953728, 68699150336, 68699543552, 68715331584, 68715724800, 68715921408, 68716314624. - Robert Israel, Mar 10 2019

Crossrefs

Cf. A306607. Includes A048701.

Programs

  • Maple
    f:= proc(n) local L;
      L:= convert(n, base, 2);
      while nops(L) > 1 do
        L:= L[2..-1]-L[1..-2]
      od;
      op(L)
    end proc:
    select(f=0, [$0..10000]);
  • Mathematica
    seqQ[n_] := NestWhile[Differences, Reverse[IntegerDigits[n, 2]], Length[#]>1&] == {0}; Select[Range[0, 3000], seqQ] (* Amiram Eldar, Mar 08 2019 *)

A371238 Euler totient function applied to the binary palindromes of even length.

Original entry on oeis.org

2, 6, 8, 20, 24, 32, 36, 84, 96, 80, 108, 96, 144, 120, 128, 324, 320, 288, 420, 336, 360, 476, 384, 512, 432, 560, 540, 504, 632, 480, 600, 1364, 960, 1344, 1296, 1536, 1440, 1296, 1584, 1296, 1772, 1512, 1280, 1760, 1440, 1980, 1800, 1600, 1800, 2016, 1536, 1872
Offset: 1

Views

Author

Amiram Eldar, Mar 16 2024

Keywords

Crossrefs

Programs

  • Mathematica
    EulerPhi[Select[Range[5000], EvenQ[Length[(d = IntegerDigits[#, 2])]] && PalindromeQ[d] &]]
  • PARI
    is(n) = Vecrev(n = binary(n)) == n && !((#n)%2);
    lista(kmax) = for(k = 1, kmax, if(is(k), print1(eulerphi(k), ", ")));

Formula

a(n) = A000010(A048701(n)).
(1/N(k)) * Sum_{j, A070939(A048701(j)) = 2*k} a(j) = 3 * 2^(2*k-2) * (6/Pi^2 + O((k/log(k))^(-1/4))), where N(k) = Sum_{j, A070939(A048701(j)) = 2*k} 1 (Banks and Shparlinski, 2006).
Previous Showing 11-14 of 14 results.