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-29 of 29 results.

A233573 Number of ways n can be partitioned as A233010(i)+A233572(j), where i,j >= 1.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Dec 13 2013

Keywords

Comments

Number in sequence A233010 takes palindrome form when written in balanced ternary notation and left patch same number of zeros as number of trailing zeros, which means that if we slice the balanced ternary notation number with left zero padding in the middle, the left part is a mirrored image of the right part. This is a feature like an even function.
Number in sequence A233571 takes "reversed palindrome form" when written in balanced ternary notation and left patch same number of zeros as number of trailing zeros, which means that if we slice the balanced ternary notation number with left zero padding in the middle, the left part is a mirrored image of the right part with sign changes. This is a feature like an odd function.
This sequence gives the number of possibilities of such partitions.
In the first 10000 terms, 152 zeros found.

Examples

			0=0+0=A233010(1)+A233572(1). This is the only valid partition by definition. So a(0)=1.
3=3+0=A233010(3)+A233572(1), as well 3=1+2=A233010(2)+A233572(2).
  Two valid partitions found. So a(3)=2.
9=9+0=7+2=3+6=1+8, four valid partitions found. So a(9)=4.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    (*This is to determine digits of a number in balanced ternary notation.*)
    Module[{n = m, d, sign, t = g},
      If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
       d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
       While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign;
         t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    BTpaleQ[n_Integer] :=
    (*This is to query if a number is an element of sequence A233010.*)
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; t == Reverse[t]];
    BTrteQ[n_Integer] :=
    (*This is to query if a number is an element of sequence A233572.*)
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; DeleteDuplicates[t + Reverse[t]] == {0}];
    sa = Select[Range[0, 11000], BTpaleQ[#] &];
    (*This is to generate a limited list of A233010.*)
    sb = Select[Range[0, 11000], BTrteQ[#] &];
    (*This is to generate a limited list of A233572.*)
    range = 86; Table[ct = 0; i1 = 0;
    While[i1++; sa[[i1]] <= n, i2 = 0;
      While[i2++; (sa[[i1]] + sb[[i2]]) <= n,
       If[(sa[[i1]] + sb[[i2]]) == n, ct++]]]; ct, {n, 0, range}]

A235028 Fixed points of A235027.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 25, 27, 28, 30, 31, 32, 34, 35, 36, 40, 42, 45, 48, 49, 50, 51, 54, 56, 60, 62, 63, 64, 68, 70, 72, 73, 75, 80, 81, 84, 85, 90, 93, 96, 98, 100, 102, 105, 107, 108, 112, 119, 120, 124, 125
Offset: 1

Views

Author

Antti Karttunen, Jan 02 2014

Keywords

Comments

The first 20 terms are equal with A057890, after which a(21)=25, while A057890(21)=27. On the other hand, 33 is the first term which occurs in A057890 but does not occur here.
If terms x and y are included, then also their product x*y is included. If term x is included, then 2^k * x is also included. The sequence contains also all primes in A016041 and their mutual multiples. However, in addition to that, there are also terms like 143 = 11*13, where A235027 will map the factors to each other (as their binary expansions '1011' and '1101' are mirror images of each other), even although neither of them is present in A016041. (These latter kind of primes are in A074832).
Please use the "graph" link to see how the terms get rarer.

Crossrefs

The primes in this sequence: A016041.

A345362 Fixed points of A345352.

Original entry on oeis.org

0, 1, 2, 3, 12, 15, 96, 102, 105, 111, 144, 150, 153, 159, 240, 246, 249, 255, 6144, 6168, 6180, 6204, 6210, 6234, 6246, 6270, 6273, 6297, 6309, 6333, 6339, 6363, 6375, 6399, 9216, 9240, 9252, 9276, 9282, 9306, 9318, 9342, 9345, 9369, 9381, 9405, 9411, 9435
Offset: 1

Views

Author

Rémy Sigrist, Jun 16 2021

Keywords

Comments

The binary expansion of a term > 1 can be split into two symmetrical parts of the same size (this size being a power of 2) (possibly after adjoining some leading 0's), and the first part contains at least one 1.
If m is a term, then A001196(m) is also a term.

Examples

			A345352(96) = 96, so 96 belongs to this sequence.
		

Crossrefs

Programs

  • PARI
    is(n) = { my (b=binary(n), x); for (k=1, oo, x=2^k-#b; if (x>=0, b=concat(vector(x), b); return (n==fromdigits(concat(Vecrev(b[1..#b/2]), Vecrev(b[#b/2+1..#b])), 2)))) }
    
  • PARI
    See Links section.
    
  • Python
    def A345352(n):
        b = bin(n)[2:]
        bb = bin(len(b))[2:]
        if bb != '1' + '0'*(len(bb)-1): b = '0'*(2**len(bb) - len(b)) + b
        return int(b[:len(b)//2][::-1] + b[len(b)//2:][::-1], 2)
    def ok(n): return A345352(n) == n
    print(list(filter(ok, range(9436))))  # Michael S. Branicky, Jun 16 2021

A069024 Numbers that are palindromic in base 2 as well as in base 10 (initial zeros may be prepended).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 33, 40, 60, 66, 80, 90, 99, 252, 272, 292, 313, 330, 585, 626, 660, 717, 990, 2112, 2720, 2772, 2920, 4224, 5850, 6336, 7447, 7470, 8448, 8580, 9009, 15351, 21120, 22122, 25752, 32223, 39993, 40904, 42240, 44244, 48384
Offset: 1

Views

Author

Amarnath Murthy, Apr 02 2002

Keywords

Examples

			66 in base 2 is 1000010, which is palindromic if rewritten as 01000010.
		

Crossrefs

Cf. A007632.
Intersection of A061917 and A057890.

Programs

  • Maple
    nextpal:= proc(p,d,V,b)
      local i,i2,pp,m,m2;
      pp:=p;
      V[1]:= V[1]+1;
      m2:= floor(d/2);
      i2:= ceil(d/2);
      if d::odd then pp:= pp + b^m2 else pp:= pp + b^m2 + b^(m2-1) fi;
      for i from 1 while V[i] = b do
        V[i]:= 0:
        if i = i2 then
          if d::even then
            ArrayTools:-Extend(V,[1],inplace);
            return b^d+1, d+1, V
          else
            V[i2]:= 1;
            return b^d+1, d+1, V;
          fi;
        fi;
        V[i+1]:= V[i+1]+1;
        if (d::odd and i=1) then pp:= pp + b^(i2-i-1) else
          pp:= pp + b^(i2-i-1) - b^(i2-i+1) fi;
      od;
      return pp, d, V
    end proc:
    count:= 1:
    S:= 0:
    p2[0]:=1: V2[0]:= <1>: d2[0]:= 1:m2:= 0:
    p10[0]:= 1: V10[0]:= <1>: d10[0]:= 1: m10:= 0:
    while count < 100 do
      i2:= min[index]([seq(p2[i],i=0..m2)])-1; p2o:= p2[i2];
      i10:= min[index]([seq(p10[i],i=0..m10)])-1; p10o:= p10[i10];
      if p2o = p10o then
        S:= S, p2o; count:= count+1;
      fi;
      if p2o <= p10o then x, d2[i2], V2[i2]:= nextpal(p2o/2^i2, d2[i2], V2[i2],2); p2[i2]:= 2^i2 *x;
        if i2 = m2 then m2:= m2+1; p2[m2]:= 2^m2; V2[m2]:= <1>; d2[m2]:= 1;
     fi;
      else
        x, d10[i10], V10[i10]:= nextpal(p10o/10^i10, d10[i10], V10[i10],10);
        p10[i10]:= 10^i10 * x;
        if i10 = m10 then m10:= m10+1; p10[m10]:= 10^m10; V10[m10]:= <1>; d10[m10]:= 1
    fi fi od:
    S; # Robert Israel, Apr 01 2024
  • Mathematica
    pal[n_, b_] := (z=IntegerDigits[n, b]) == Reverse[z]; extpal[n_, b_] := If[Mod[n, b]>0, pal[n, b], extpal[n/b, b]]; Select[Range[50000], extpal[ #, 10]&&extpal[ #, 2]&]

Extensions

Edited by Dean Hickerson, Apr 06 2002
0 inserted by Sean A. Irvine, Mar 29 2024

A233574 a(n) is the smallest term of either A233010 or A233572 such that |n-a(n)|

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 4, 6, 8, 6, 6, 8, 8, 7, 12, 8, 10, 9, 10, 13, 12, 13, 16, 20, 16, 18, 26, 18, 18, 20, 18, 18, 20, 20, 18, 26, 20, 24, 26, 21, 24, 21, 26, 43, 32, 24, 28, 26, 28, 43, 30, 27, 28, 27, 28, 54, 30, 39, 40, 32, 32, 43, 32, 39, 40, 39, 40, 43, 36
Offset: 0

Views

Author

Lei Zhou, Dec 13 2013

Keywords

Comments

It is conjectured that a(n) exists for all n >= 0.

Examples

			a(19)=13 since 19=13+6=A233010(9)+A233572(3) and 13>6. There is no number in A233010 or A233572 smaller than 13 that satisfies the same condition.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    (*This is to determine digits of a number in balanced ternary notation.*)
    Module[{n = m, d, sign, t = g},
      If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
       d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
       While[Length[t] < d, PrependTo[t, 0]];
       t[[Length[t] + 1 - d]] = sign;
       t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    BTpaleQ[n_Integer] :=
    (*This is to query if a number is an element of sequence A233010.*)
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; t == Reverse[t]];
    BTrteQ[n_Integer] :=
    (*This is to query if a number is an element of sequence A233572.*)
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; DeleteDuplicates[t + Reverse[t]] == {0}];
    sa = Select[Range[0, 30000], BTpaleQ[#] &];
    (*This is to generate a limited list of A233010.*)
    sb = Select[Range[0, 30000], BTrteQ[#] &];
    (*This is to generate a limited list of A233572.*)
    range = 68; Table[i1 = 0; i2 = 0;
    While[If[sa[[i1 + 1]] < sb[[i2 + 1]], i1++; nh = sa[[i1]]; isa = 1,
       i2++; nh = sb[[i2]]; isa = 0]; (2*nh) < n];
    While[If[isa == 0, chk = MemberQ[sa, Abs[n - nh]],
       chk = MemberQ[sb, Abs[n - nh]]]; ! chk,
      If[sa[[i1 + 1]] < sb[[i2 + 1]], i1++; nh = sa[[i1]]; isa = 1, i2++;
       nh = sb[[i2]]; isa = 0]];
    If[isa == 0, m = sb[[i2]], m = sa[[i1]]]; m, {n, 0, range}]

A233580 In balanced ternary notation, zerofree non-repdigit numbers that are either palindromes or sign reversed palindromes.

Original entry on oeis.org

2, 7, 16, 20, 32, 43, 61, 103, 124, 146, 182, 196, 292, 302, 338, 367, 421, 547, 601, 859, 913, 1039, 1096, 1172, 1280, 1312, 1600, 1640, 1748, 1816, 2560, 2624, 2732, 2776, 3064, 3092, 3200, 3283, 3445, 3823, 3985, 4759, 4921, 5299, 5461, 7663, 7825, 8203
Offset: 1

Views

Author

Lei Zhou, Dec 14 2013

Keywords

Comments

Zerofree numbers in balanced ternary notation can be used as reversible sign operators. This sequence collects such operators that are either in palindrome form or sign reversed palindrome form (which is defined as (n)_bt+Reverse((n)_bt)=0).

Examples

			2 = (1T)_bt in balanced ternary notation, where we use T to represent -1.
1T + T1 = 0, matches the definition of sign reversed palindrome form. So 2 is in the sequence.
Other examples:
7 = (1T1_bt) - palindrome; in the sequence.
13 = (111)_bt - palindrome but repdigit; not in the sequence.
16 = (1TT1)_bt - palindrome; in the sequence.
...
52 = (1T0T1)_bt - palindrome but not zerofree; not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    (* This is to determine digits of a number in balanced ternary notation. *)
    Module[{n = m, d, sign, t = g},  If[n != 0, If[n > 0, sign = 1,
      sign = -1; n = -n];   d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];   While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign;   t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    BTnum[g_]:=Module[{bo=Reverse[g],data=0,i},Do[data=data+3^(i-1)*bo[[i]],{i,1,Length[bo]}];data];
    ct=0;n=0;dg=0;spool={};res={};While[ct<50,n++; nbits = BTDigits[n, {0}];cdg=Length[nbits];If[cdg>dg,If[Length[spool]>0,Do[bits=spool[[j]];If[!MemberQ[bits,0],rb=Reverse[bits]; sign=rb[[1]];bo=Join[bits,-sign*rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]];bo=Join[bits,sign*rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]]],{j,1,Length[spool]}];Do[bits=spool[[j]];If[!MemberQ[bits,0],rb=Reverse[bits];bo=Join[bits,{-1},rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]];bo=Join[bits,{1},rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]]],{j,1,Length[spool]}];spool={};dg=cdg]];AppendTo[spool,nbits]];Print[res]

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

A331804 a(n) is the largest positive integer occurring, when written in binary, as a substring in both binary n and its reversal (A030101(n)).

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 5, 3, 5, 7, 15, 1, 17, 9, 9, 5, 21, 6, 7, 3, 9, 5, 27, 7, 7, 15, 31, 1, 33, 17, 17, 9, 9, 9, 9, 5, 9, 21, 21, 6, 45, 14, 15, 3, 17, 9, 51, 5, 21, 27, 27, 7, 9, 7, 27, 15, 15, 31, 63, 1, 65, 33, 33, 17, 17, 17, 17, 9, 73, 10, 9
Offset: 0

Views

Author

Rémy Sigrist, Jan 26 2020

Keywords

Comments

We set a(0) = 0 by convention.
a(7479) = 29 ("11101" in binary) is the first term that does not belong to A057890.

Examples

			The first terms, alongside the binary representations of n and of a(n), are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1      10          1
   3     3      11         11
   4     1     100          1
   5     5     101        101
   6     3     110         11
   7     7     111        111
   8     1    1000          1
   9     9    1001       1001
  10     5    1010        101
  11     5    1011        101
  12     3    1100         11
		

Crossrefs

Programs

  • PARI
    sub(n) = { my (b=binary(n), s=[0]); for (i=1, #b, if (b[i], for (j=i, #b, s=setunion(s, Set(fromdigits(b[i..j], 2)))))); return (s) }
    a(n) = my (i=setintersect(sub(n), sub(fromdigits(Vecrev(binary(n)),2)))); i[#i]

Formula

a(n) = A175466(n, A030101(n)) for any n > 0.
a(n) <= n with equality iff n is a binary palindrome (A006995).

A374991 Lexicographically earliest sequence of distinct nonnegative integers such that the concatenation of the binary expansions of two consecutive terms, in at least one way, and after removal of trailing digits, is palindromic.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 11, 5, 10, 8, 13, 16, 15, 12, 19, 9, 18, 36, 32, 22, 26, 23, 14, 28, 31, 24, 29, 46, 58, 47, 20, 37, 41, 74, 72, 39, 25, 38, 50, 76, 51, 102, 103, 57, 48, 54, 27, 44, 52, 75, 82, 64, 42, 21, 43, 53, 86, 40, 45, 80, 89, 77, 144, 79, 60, 30
Offset: 0

Views

Author

Rémy Sigrist, Jul 26 2024

Keywords

Examples

			The first terms, in decimal and in binary, alongside an appropriate palindrome (with dots denoting the removed trailing zeros), are:
  n   a(n)  bin(a(n))  palindrome
  --  ----  ---------  ----------
   0     0          0           1
   1     1          1         11.
   2     2         10        111.
   3     3         11       111..
   4     4        100      1111..
   5     7        111      11111.
   6     6        110     1101011
   7    11       1011     1011101
   8     5        101     101101.
   9    10       1010    10101...
  10     8       1000    11011...
  11    13       1101   11011....
  12    16      10000   11111....
		

Crossrefs

Programs

  • PARI
    \\ See Links section.
Previous Showing 21-29 of 29 results.