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-20 of 33 results. Next

A044918 Positive integers whose base-2 run lengths form a palindrome.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 10, 12, 15, 17, 21, 27, 31, 33, 38, 42, 45, 51, 52, 56, 63, 65, 73, 85, 93, 99, 107, 119, 127, 129, 142, 150, 153, 165, 170, 178, 189, 195, 204, 212, 219, 231, 232, 240, 255, 257, 273, 297, 313, 325, 341, 365, 381
Offset: 1

Views

Author

Keywords

Comments

This sequence exactly contains those positive integers in A006995 (positive binary palindromes) together with the terms of A035928 (those positive integers n where reversing the order of the binary digits produces the binary complement of n). - Leroy Quet, Sep 14 2009
Also the indices of the compositions that are palindromic. For the definition of the index of a composition see A298644. For example, 93 is in the sequence since its binary form is 1011101 and the composition [1,1,3,1,1] is palindromic. On the other hand, 132 is not in the sequence since its binary form is 10000100 and the composition [1,4,1,2] is not palindromic. The command c(n) from the Maple program yields the composition having index n. - Emeric Deutsch, Jan 28 2018

Crossrefs

Cf. A006995, A035928. - Leroy Quet, Sep 14 2009
Cf. A298644, A101211. - Emeric Deutsch, Jan 28 2018

Programs

  • Maple
    Runs:=proc(L) local j,r,i,k:j:=1: r[j]:=L[1]: for i from 2 to nops(L) do if L[i]=L[i-1] then r[j]:=r[j], L[i] else j:=j+1: r[j]:=L[i] end if end do: [seq([r[k]],k=1..j)] end proc: RunLengths:=proc(L) map(nops,Runs(L)) end  proc: c:=proc(n) ListTools:-Reverse(convert(n,base,2)): RunLengths(`%`) end proc: A:={}: for n from 1 to 500 do crev(n):=[seq(c(n)[1+ nops(c(n))-j],j=1..nops(c(n)))] od:  for n from 1 to 500 do if c(n)=crev(n) then A:=A union {n} else fi od: A; # most of the Maple program is due to W. Edwin Clark. # Emeric Deutsch, Jan 28 2018
  • Mathematica
    Position[Array[Length /@ Split@ IntegerDigits[#, 2] &, 400], ? PalindromeQ, 1] // Flatten (* _Michael De Vlieger, Jan 28 2018 *)
  • PARI
    ispal(v) = {for(i=1, #v\2, if (v[i] != v[#v-i+1], return(0));); return(1);}
    isok(n) = {b = binary(n); lastb = b[1]; vrun = vector(1); vrun[1] = 1; for (i=2, #b, if (b[i] != lastb, vrun = concat(vrun, 1); lastb = b[i];, vrun[#vrun]++;)); return (ispal(vrun));} \\ Michel Marcus, Jul 10 2013

A061855 Symmetric totally balanced binary sequences: those terms of A014486 which are equal to their reversed complement.

Original entry on oeis.org

0, 2, 10, 12, 42, 52, 56, 170, 178, 204, 212, 232, 240, 682, 722, 738, 812, 852, 868, 920, 936, 976, 992, 2730, 2762, 2866, 2898, 2978, 3010, 3244, 3276, 3380, 3412, 3492, 3524, 3640, 3672, 3752, 3784, 3888, 3920, 4000, 4032, 10922, 11082, 11146
Offset: 0

Views

Author

Antti Karttunen, May 11 2001

Keywords

Comments

These encode symmetric (palindromic) structures in many of the Catalan families, e.g. mountain ranges, parenthesizations, unlabeled rooted plane trees.

Examples

			E.g. the 45th term 11146 is 10101110001010 in binary and can be interpreted as a parenthesization: ( )( )((( )))( )( )
		

Crossrefs

Obtained by "reflecting" the terms of A061854. Cf. also A035928 (ReflectBinSeq), A061856, A069766.

Programs

  • Maple
    map(op,[seq(PalTotBalBinSequences(j),j=1..10)]);
    PalTotBalBinSequences := n -> map(ReflectBinSeq,NonDivingLatticeSequences(n), n);

Formula

a(0) = 0 and the rest with the Maple function map(op, [seq(PalTotBalBinSequences(j), j=1..10)]);

A140900 A nonnegative integer n is included if the binary representation of n and the digit-reversal (with leading 0's) of the binary representation of n do not have any 1's in the same position.

Original entry on oeis.org

0, 2, 4, 8, 10, 12, 16, 18, 24, 32, 34, 36, 38, 40, 42, 48, 52, 56, 64, 66, 68, 70, 80, 82, 96, 100, 112, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 160, 162, 168, 170, 176, 178, 192, 196, 200, 204, 208, 212, 224, 232, 240, 256, 258, 260, 262, 264
Offset: 1

Views

Author

Leroy Quet, Jul 24 2008

Keywords

Comments

All terms of this sequence are even.
Number of terms less than or equal to 10^n: 1, 5, 26, 162, 1045, 5976, 38980, 249229, 1416583, 9381238, ..., . - Robert G. Wilson v, Aug 04 2008
Number of terms < 2^k: 1, 2, 3, 6, 18, 27, 54, 81,... (A038754). - T. D. Noe, Apr 09 2009

Examples

			36 in binary is 100100. The digit-reversal (with leading 0's) of this is 001001. These binary representations have no 1's in the same location (i.e., they can be added in binary without any carries). So 36 is in this sequence.
		

Crossrefs

A035928 is a subsequence.

Programs

  • Mathematica
    fQ[n_] := Block[{id = IntegerDigits[n, 2]}, Max@ Union[id + Reverse@ id] < 2]; Select[2 Range[0, 134], fQ@# &] (* Robert G. Wilson v, Aug 04 2008 *)
  • PARI
    is(n) = my (b=if (n, binary(n), [0])); vecmax(b+Vecrev(b))<=1 \\ Rémy Sigrist, Jun 11 2022

Extensions

More terms from Robert G. Wilson v, Aug 04 2008

A195066 Numbers n such that BCR(n) is not less than n, where BCR = binary-complement-and-reverse = A036044.

Original entry on oeis.org

0, 2, 4, 8, 10, 12, 16, 18, 20, 24, 32, 34, 36, 38, 40, 42, 44, 48, 52, 56, 64, 66, 68, 70, 72, 74, 76, 80, 82, 84, 88, 92, 96, 100, 104, 112, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 160, 162, 164, 168, 170, 172, 176, 178
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 16 2011

Keywords

Comments

A035928(a(n)) >= n.

Programs

  • Haskell
    a195066 n = a195066_list !! (n-1)
    a195066_list = filter (\x -> a036044 x >= x) [0,2..]

A195063 Numbers n such that BCR(n) is less than n, where BCR = binary-complement-and-reverse = A036044.

Original entry on oeis.org

6, 14, 22, 26, 28, 30, 46, 50, 54, 58, 60, 62, 78, 86, 90, 94, 98, 102, 106, 108, 110, 114, 116, 118, 120, 122, 124, 126, 158, 166, 174, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 220, 222, 226, 228, 230, 234, 236, 238, 242, 244, 246, 248, 250, 252
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 16 2011

Keywords

Comments

A035928(a(n)) < n.

Crossrefs

Complement of A195066; subsequence of A195064; cf. A035928, A195065.

Programs

  • Haskell
    a195063 n = a195063_list !! (n-1)
    a195063_list = filter (\x -> a036044 x < x) [0,2..]

A195064 Numbers n such that BCR(n) is not greater than n, where BCR = binary-complement-and-reverse = A036044.

Original entry on oeis.org

2, 6, 10, 12, 14, 22, 26, 28, 30, 38, 42, 46, 50, 52, 54, 56, 58, 60, 62, 78, 86, 90, 94, 98, 102, 106, 108, 110, 114, 116, 118, 120, 122, 124, 126, 142, 150, 158, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 204, 206, 210, 212, 214, 218, 220, 222, 226
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 16 2011

Keywords

Comments

A035928(a(n)) <= n.

Crossrefs

Complement of A195065; A035928 and A195063 are subsequences; cf. A195066.

Programs

  • Haskell
    a195064 n = a195064_list !! (n-1)
    a195064_list = filter (\x -> a036044 x <= x) [0,2..]

A195065 Numbers n such that BCR(n) is greater than n, where BCR = binary-complement-and-reverse = A036044.

Original entry on oeis.org

0, 4, 8, 16, 18, 20, 24, 32, 34, 36, 40, 44, 48, 64, 66, 68, 70, 72, 74, 76, 80, 82, 84, 88, 92, 96, 100, 104, 112, 128, 130, 132, 134, 136, 138, 140, 144, 146, 148, 152, 154, 156, 160, 162, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 208, 216, 224
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 16 2011

Keywords

Comments

A035928(a(n)) > n.

Crossrefs

Complement of A195064; subsequence of A195066.

Programs

  • Haskell
    a195065 n = a195065_list !! (n-1)
    a195065_list = filter (\x -> a036044 x > x) [0,2..]
    
  • Python
    def comp(s): z, o = ord('0'), ord('1'); return s.translate({z:o, o:z})
    def BCR(n): return int(comp(bin(n)[2:])[::-1], 2)
    def aupto(limit): return [m for m in range(limit+1) if BCR(m) > m]
    print(aupto(224)) # Michael S. Branicky, Jun 14 2021

A277238 Folding numbers (see comments for the definition).

Original entry on oeis.org

1, 2, 6, 10, 12, 22, 28, 38, 42, 52, 56, 78, 90, 108, 120, 142, 150, 170, 178, 204, 212, 232, 240, 286, 310, 346, 370, 412, 436, 472, 496, 542, 558, 598, 614, 666, 682, 722, 738, 796, 812, 852, 868, 920, 936, 976, 992, 1086, 1134, 1206, 1254, 1338, 1386, 1458, 1506, 1596, 1644, 1716, 1764, 1848, 1896, 1968
Offset: 1

Views

Author

Taylor J. Smith, Oct 06 2016

Keywords

Comments

Folding numbers: Numbers with an even number of bits in their binary expansion such that the XOR of the left half and the reverse of the right half is the all-1's string. Numbers with an odd number of bits in their binary expansion such that the central bit is 1, and the XOR of the left (n-1)/2 bits and the reverse of the right (n-1)/2 bits is the all-1's string.
Folding numbers with an even (resp. odd) number of bits form A035928 (resp. A276795). - N. J. A. Sloane, Nov 03 2016

Examples

			178 in base 2 is 10110010. Taking the XOR of 1011 and 0100 (which is 0010 reversed) gives the result 1111, so 178 is in the sequence.
		

Crossrefs

Programs

  • Maple
    N:= 16: # to get all terms < 2^N
    M[1]:= [[1]]: M[2]:= [[1,0]]:
    for d from 3 to N by 2 do
      M[d]:= map(L -> [op(L[1..(d-1)/2]),1,op(L[(d+1)/2..-1])], M[d-1]);
      if d < N then
        M[d+1]:= map(L -> ([op(L[1..(d-1)/2]),0,1,op(L[(d+1)/2..-1])],[op(L[1..(d-1)/2]),1,0,op(L[(d+1)/2..-1])]), M[d-1])
      fi
    od:
    seq(seq(add(L[-i]*2^(i-1),i=1..d),L=M[d]),d=1..N); # Robert Israel, Nov 09 2016
  • Mathematica
    {1}~Join~Select[Range@ 2000, If[OddQ@ Length@ # && Take[#, {Ceiling[ Length[#]/2]}] == {0}, False, Union[Take[#, Floor[Length[#]/2]] + Reverse@ Take[#, -Floor[Length[#]/2]]] == {1}] &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Oct 07 2016 *)
  • PARI
    isok(n) = {if (n==1, return(1)); b = binary(n); if ((#b % 2) && (b[#b\2+1] == 0), return (0)); vecmin(vector(#b1, k, bitxor(b[k], b[#b-k+1]))) == 1;} \\ Michel Marcus, Oct 07 2016

A276795 Folding numbers with an odd number of bits (see A277238 for definition).

Original entry on oeis.org

1, 6, 22, 28, 78, 90, 108, 120, 286, 310, 346, 370, 412, 436, 472, 496, 1086, 1134, 1206, 1254, 1338, 1386, 1458, 1506, 1596, 1644, 1716, 1764, 1848, 1896, 1968, 2016, 4222, 4318, 4462, 4558, 4726, 4822, 4966, 5062, 5242, 5338, 5482, 5578, 5746, 5842, 5986
Offset: 1

Views

Author

N. J. A. Sloane, Nov 03 2016

Keywords

Comments

Terms greater than 1 are obtained by inserting a 1 in the middle of the binary expansions of the terms of A035928.

Examples

			78 is binary 1001110. There is a 1 in the center bit. The first 3 bits (100) and the last 3 reversed (011) sums to 111, so 78 is in the sequence.
70 is binary 1000110. There is a 0 in the center bit, thus, despite the fact that the first and last 3 bits have the same relationship as above, 70 is not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    {1}~Join~Select[Flatten@ Array[Range[#, 2 # - 1] &[2^#] &[2 (# - 1)] &, 7], If[OddQ@ Length@ # && Take[#, {Ceiling[Length[#]/2]}] == {0}, False, Union[Take[#, Floor[Length[#]/2]] + Reverse@ Take[#, -Floor[ Length[#]/2]]] == {1}] &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Nov 25 2016 *)

Extensions

More terms from Lars Blomberg, Nov 09 2016

A284798 Antipalindromic numbers in base 3.

Original entry on oeis.org

1, 4, 6, 13, 21, 34, 40, 46, 60, 66, 72, 97, 121, 145, 177, 201, 225, 268, 286, 304, 346, 364, 382, 424, 442, 460, 510, 528, 546, 588, 606, 624, 666, 684, 702, 781, 853, 925, 1021, 1093, 1165, 1261, 1333, 1405, 1509, 1581, 1653, 1749, 1821, 1893, 1989, 2061, 2133
Offset: 1

Views

Author

Paolo P. Lava, Apr 03 2017

Keywords

Comments

Fixed points of the transform A284797.
A b-adic "antipalindrome" is a string of digits x where the application of the map d -> b-1-d to each digit, followed by reversal of all digits, is equal to x. This sequence lists the integers whose base-3 representation (with no leading zeros) has this property.

Examples

			34 is a term of the sequence because 34 in base 3 is 1021, its digit-by-digit complement in base 3 is 1201 and the digit reverse is again 1021.
		

Crossrefs

Programs

  • Maple
    P:=proc(q,h) local a,b,k,n; for n from 1 to q do a:=convert(n,base,h); b:=0;
    for k from 1 to nops(a) do a[k]:=h-1-a[k]; b:=h*b+a[k]; od; if b=n then print(n); fi; od; end: P(10^2,8);
  • Python
    from itertools import count, islice
    from gmpy2 import digits
    def A284798_gen(): return (n for n in count(0) if not n+int((s:=digits(n,3)[::-1]),3)+1-3**len(s))
    A284798_list = list(islice(A284798_gen(),35)) # Chai Wah Wu, Feb 04 2022

Extensions

New name from Jeffrey Shallit, Nov 04 2023
Previous Showing 11-20 of 33 results. Next