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.

A257869 Nonnegative integers with an equal number of occurrences of all trits in balanced ternary representation.

Original entry on oeis.org

6, 8, 136, 138, 144, 154, 156, 160, 164, 168, 170, 180, 186, 188, 208, 210, 214, 218, 222, 224, 232, 236, 248, 258, 260, 266, 288, 294, 296, 312, 314, 320, 3406, 3412, 3414, 3430, 3432, 3438, 3484, 3486, 3492, 3510, 3568, 3574, 3576, 3592, 3594, 3600, 3622
Offset: 1

Views

Author

Alois P. Heinz, May 11 2015

Keywords

Examples

			6 = 1L0_bal3, 8 = 10L_bal3, 136 = 1LL001_bal3, 138 = 1LL010_bal3, 144 = 1LL100_bal3, where L represents (-1).
		

Crossrefs

Subsequence of A174658.

Programs

  • Maple
    p:= proc(n) local d, m, r; m:=n; r:=0;
          while m>0 do
            d:= irem(m, 3, 'm');
            if d=2 then m:=m+1 fi;
            r:= r+x^d
          od;
          simplify(r/(1+x+x^2))::integer
        end:
    a:= proc(n) option remember; local k;
          for k from 1+`if`(n=1, 0, a(n-1)) by 1
          while not p(k) do od; k
        end:
    seq(a(n), n=1..70);
  • Python
    def a(n):
        s=[]
        x=0
        while n>0:
            x=n%3
            n//=3
            if x==2:
                x=-1
                n+=1
            s.append(x)
        return s
    print([n for n in range(1, 5001) if a(n).count(1)==a(n).count(-1) and a(n).count(-1)==a(n).count(0)]) # Indranil Ghosh, Jun 07 2017

A257868 Negative integers n such that in balanced ternary representation the number of occurrences of each trit doubles when n is squared.

Original entry on oeis.org

-314, -898, -942, -2694, -2824, -2826, -2962, -3014, -3070, -3074, -8066, -8082, -8090, -8096, -8132, -8170, -8224, -8336, -8426, -8434, -8450, -8472, -8478, -8480, -8618, -8656, -8870, -8886, -8918, -9008, -9042, -9210, -9222, -9224, -24198, -24226, -24246
Offset: 1

Views

Author

Alois P. Heinz, May 11 2015

Keywords

Examples

			-898 is in the sequence because -898 = LL10L1L_bal3 and (-898)^2 = 806404 = 1LLLL00L1LLL11_bal3, where L represents (-1).
		

Crossrefs

Programs

  • Maple
    p:= proc(n) local d, m, r; m:=abs(n); r:=0;
          while m>0 do
            d:= irem(m, 3, 'm');
            if d=2 then m:=m+1 fi;
            r:=r+x^`if`(n>0, d, irem(3-d, 3))
          od; r
        end:
    a:= proc(n) option remember; local k;
          for k from -1+`if`(n=1, 0, a(n-1)) by -1
          while p(k)*2<>p(k^2) do od; k
        end:
    seq(a(n), n=1..50);
  • Python
    def a(n):
        s=[]
        l=[]
        x=0
        while n>0:
            x=n%3
            n//=3
            if x==2:
                x=-1
                n+=1
            s.append(x)
            l.append(-x)
        return [s, l]
    print([-n for n in range(1, 25001) if a(n**2)[0].count(-1)==2*a(n)[1].count(-1) and a(n**2)[0].count(1)==2*a(n)[1].count(1) and a(n**2)[0].count(0)==2*a(n)[1].count(0)]) # Indranil Ghosh, Jun 07 2017

A258411 Nonnegative integers n such that in bijective base-2 numeration the number of occurrences of each digit doubles when n is squared.

Original entry on oeis.org

5, 9, 17, 33, 41, 42, 65, 74, 77, 84, 85, 90, 129, 138, 145, 146, 148, 162, 166, 168, 173, 180, 257, 266, 274, 276, 279, 282, 285, 292, 296, 297, 301, 307, 310, 322, 324, 330, 332, 336, 341, 345, 349, 354, 360, 513, 522, 530, 532, 538, 545, 546, 548, 552, 562
Offset: 1

Views

Author

Alois P. Heinz, May 29 2015

Keywords

Examples

			5 = 21_bij2 and 5^2 = 25 = 2121_bij2, 42 = 12122_bij2 and 42^2 = 1764 = 2122211212_bij2.
		

Crossrefs

Programs

  • Maple
    p:= proc(n) local d, m, r; m:= n; r:= 0;
          while m>0 do d:= irem(m, 2, 'm');
            if d=0 then d:=2; m:= m-1 fi;
            r:= r+x^d
          od; r
        end:
    a:= proc(n) option remember; local k;
          for k from 1+`if`(n=1, 0, a(n-1))
          while p(k)*2<>p(k^2) do od; k
        end:
    seq(a(n), n=1..60);
Showing 1-3 of 3 results.