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

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