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.

Showing 1-5 of 5 results.

A233572 In balanced ternary notation, if prepending same numbers of zeros, reverse digits of a(n) equals to -a(n).

Original entry on oeis.org

0, 2, 6, 8, 18, 20, 24, 26, 32, 54, 56, 60, 72, 78, 80, 96, 104, 146, 162, 164, 168, 180, 182, 216, 224, 234, 240, 242, 260, 288, 302, 312, 320, 338, 416, 438, 486, 488, 492, 504, 540, 546, 560, 648, 656, 672, 702, 720, 726, 728, 780, 800, 864, 896, 906, 936
Offset: 1

Views

Author

Lei Zhou, Dec 13 2013

Keywords

Comments

A233571 is a subset of this sequence.

Examples

			In balanced ternary notation, 18 = (1T00)_bt, where we use T to represent -1.  Patching two zeros before it, (1T00)_bt=(001T00)_bt.  The reverse digits of (001T00)_bt is (00T100)_bt = -18.  So 18 is in this sequence.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    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];
    BTrteQ[n_Integer] :=
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; DeleteDuplicates[t + Reverse[t]] == {0}];
    sb = Select[Range[0, 950], BTrteQ[#] &]

A377625 Nonnegative numbers whose nonadjacent form is antipalindromic.

Original entry on oeis.org

0, 3, 7, 15, 31, 51, 63, 75, 99, 127, 155, 195, 231, 255, 279, 315, 387, 455, 511, 567, 635, 723, 771, 819, 903, 975, 1023, 1071, 1143, 1227, 1275, 1323, 1427, 1539, 1651, 1799, 1935, 2047, 2159, 2295, 2443, 2555, 2667, 2835, 2979, 3075, 3171, 3315, 3495, 3591
Offset: 1

Views

Author

Rémy Sigrist, Dec 28 2024

Keywords

Comments

Also nonnegative numbers k such that A379015(k) = -k.

Examples

			The first terms, alongside their nonadjacent forms, are:
  n   a(n)  naf(a(n))
  --  ----  ----------
   1     0           0
   2     3         10T
   3     7        100T
   4    15       1000T
   5    31      10000T
   6    51     10T010T
   7    63     100000T
   8    75     1010T0T
   9    99    10T0010T
  10   127    1000000T
  11   155    10100T0T
  12   195   10T00010T
  13   231   100T0100T
  14   255   10000000T
  15   279   10010T00T
  16   315   101000T0T
		

Crossrefs

See A233571 for a similar sequence.

Programs

  • PARI
    is(n) = { my (m = 0, d, r = n); while (r, m *= 2; if (r % 2, r -= d = 2 - (r % 4); m += d;); r \= 2;); m == -n; }

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}]

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]
Showing 1-5 of 5 results.