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

A291771 Filter based on runlengths of 0-digits in base-3 expansion of n: a(n) = A278222(A291770(n)).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 4, 2, 2, 2, 1, 1, 2, 1, 1, 4, 2, 2, 2, 1, 1, 2, 1, 1, 8, 4, 4, 6, 2, 2, 6, 2, 2, 4, 2, 2, 2, 1, 1, 2, 1, 1, 4, 2, 2, 2, 1, 1, 2, 1, 1, 8, 4, 4, 6, 2, 2, 6, 2, 2, 4, 2, 2, 2, 1, 1, 2, 1, 1, 4, 2, 2, 2, 1, 1, 2, 1, 1, 16, 8, 8, 12, 4, 4, 12, 4, 4, 12, 6, 6, 6, 2, 2, 6, 2, 2, 12, 6, 6, 6, 2, 2, 6
Offset: 1

Views

Author

Antti Karttunen, Sep 11 2017

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; Array[If[# == 1, 1, Times @@ MapIndexed[Prime[First[#2]]^#1 &, Sort[FactorInteger[#][[All, -1]], Greater]]] &@ f[FromDigits[IntegerDigits[#, 3] /. k_ /; k < 3 :> If[k == 0, 1, 0], 2], 1, 1] &, 96] (* Michael De Vlieger, Sep 11 2017 *)

Formula

a(n) = A278222(A291770(n)).

A292244 Base-2 expansion of a(n) encodes the steps where multiples of 3 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 0, 1, 0, 0, 3, 0, 2, 5, 0, 0, 1, 0, 0, 1, 12, 6, 7, 14, 0, 1, 0, 4, 1, 8, 10, 3, 0, 0, 21, 24, 0, 1, 28, 2, 3, 2, 0, 1, 0, 0, 5, 2, 2, 1, 22, 24, 17, 0, 12, 33, 32, 14, 35, 42, 28, 45, 24, 0, 1, 16, 2, 11, 48, 0, 59, 0, 8, 3, 0, 2, 5, 0, 16, 1, 4, 20, 3, 6, 6, 7, 8, 0, 1, 56, 0, 3, 0, 42, 5, 0, 48, 5, 0, 0, 1, 14, 2, 65, 64, 56, 49, 44, 4, 49, 64, 6, 57, 0
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 3, the starting value is a multiple of three, after which follows A253889(3) = 1, the end point of iteration, which is not a multiple of three, thus a(3) = 1*(2^0) = 1.
For n = 8, the starting value is not a multiple of three, after which follows A253889(8) = 3, which is, thus a(8) = 0*(2^0) + 1*(2^1) = 2.
For n = 9, the starting value is a multiple of three, after which follows A253889(9) = 8 (which is not), while A253889(8) = 3 (which is), thus a(9) = 1*(2^0) + 0*(2^1) + 1*(2^2) = 5.
		

Crossrefs

Cf. also A292245, A292246, and A292381, A292383, A292385, and A292590, A292591 for similarly constructed sequences, and also A292250.

Programs

  • Mathematica
    f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1];g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n;Table[FromDigits[#, 2] &@ Map[Boole[Divisible[#, 3]] &,  Reverse@ NestWhileList[Floor@ g[Floor[f[#]/2]] &, n, # > 1 &]], {n, 109}] (* Michael De Vlieger, Sep 16 2017 *)
  • Scheme
    (define (A292244 n) (A291770 (A292243 n)))

Formula

a(n) = A291770(A292243(n)).
Other identities. For all n >= 1:
a(A048673(n)) = A292247(n).
a(n) + A292245(n) = A064216(n).
a(n) AND A292245(n) = a(n) AND A292246(n) = 0, where AND is a bitwise-AND (A004198).

A292250 Binary encoding of 0-digits in ternary representation of A048673(n).

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 3, 0, 2, 2, 1, 4, 6, 2, 1, 0, 0, 0, 3, 0, 0, 0, 2, 0, 5, 6, 1, 4, 1, 4, 0, 8, 0, 14, 1, 4, 12, 0, 7, 0, 4, 2, 1, 0, 5, 8, 2, 0, 4, 2, 4, 0, 4, 6, 5, 0, 5, 8, 3, 12, 2, 4, 2, 8, 0, 4, 1, 8, 3, 2, 1, 16, 16, 2, 3, 28, 0, 0, 1, 8, 0, 26, 8, 0, 9, 0, 15, 0, 1, 10, 14, 4, 0, 4, 7, 0, 4, 12, 6, 16, 5, 6, 8, 0, 2, 10, 9, 4
Offset: 1

Views

Author

Antti Karttunen, Sep 12 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Map[FromDigits[IntegerDigits[#, 3] /. k_ /; k < 3 :> If[k == 0, 1, 0], 2] &, Table[(Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n, {n, 116}]] (* Michael De Vlieger, Sep 12 2017 *)

Formula

a(n) = A291770(A048673(n)).

A292260 Binary encoding of 0-digits in ternary representation of A245612(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 2, 0, 0, 3, 2, 1, 0, 16, 8, 10, 4, 1, 2, 4, 0, 12, 0, 1, 4, 6, 0, 0, 0, 41, 34, 0, 16, 33, 22, 11, 8, 2, 0, 10, 4, 21, 10, 12, 0, 5, 26, 23, 0, 4, 4, 3, 8, 5, 14, 2, 0, 5, 2, 3, 0, 146, 80, 132, 68, 43, 2, 180, 32, 0, 68, 81, 44, 12, 16, 2, 16, 33, 6, 48, 0, 9, 22, 33, 8, 54, 40, 8, 20, 11, 26, 2, 0, 126, 8, 9, 52, 0, 48, 52, 0
Offset: 0

Views

Author

Antti Karttunen, Sep 12 2017

Keywords

Crossrefs

Formula

a(n) = A291770(A245612(n)).

A292240 Binary encoding of 0-digits in ternary representation of A254103(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 2, 0, 0, 0, 0, 2, 0, 0, 0, 1, 4, 3, 2, 1, 0, 3, 2, 1, 0, 7, 6, 0, 0, 3, 2, 4, 0, 0, 0, 1, 8, 0, 0, 6, 4, 4, 4, 2, 0, 8, 8, 6, 4, 4, 4, 5, 0, 0, 0, 1, 12, 3, 2, 0, 0, 8, 8, 9, 4, 11, 10, 0, 0, 3, 2, 4, 0, 0, 0, 2, 16, 3, 2, 1, 0, 15, 14, 0, 8, 11, 10, 1, 8, 7, 6, 5, 0, 19, 18, 1, 16, 15, 14, 13, 8, 11
Offset: 0

Views

Author

Antti Karttunen, Sep 12 2017

Keywords

Crossrefs

Formula

a(n) = A291770(A254103(n)).

A292370 A binary encoding of the zeros in base-4 representation of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			   n      a(n)     base-4(n)  binary(a(n))
                  A007090(n)  A007088(a(n))
  --      ----    ----------  ------------
   1        0          1           0
   2        0          2           0
   3        0          3           0
   4        1         10           1
   5        0         11           0
   6        0         12           0
   7        0         13           0
   8        1         20           1
   9        0         21           0
  10        0         22           0
  11        0         23           0
  12        1         30           1
  13        0         31           0
  14        0         32           0
  15        0         33           0
  16        3        100          11
  17        2        101          10
		

Crossrefs

Cf. A291770 (analogous sequence for base-3).

Programs

  • Mathematica
    Table[FromDigits[IntegerDigits[n, 4] /. k_ /; IntegerQ@ k :> If[k == 0, 1, 0], 2], {n, 0, 120}] (* Michael De Vlieger, Sep 21 2017 *)
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        k=digits(n, 4)[1:]
        return 0 if n==0 else int("".join('1' if i==0 else '0' for i in k), 2)
    print([a(n) for n in range(111)]) # Indranil Ghosh, Sep 21 2017
  • Scheme
    (define (A292370 n) (if (zero? n) n (let loop ((n n) (b 1) (s 0)) (if (< n 4) s (let ((d (modulo n 4))) (if (zero? d) (loop (/ n 4) (+ b b) (+ s b)) (loop (/ (- n d) 4) (+ b b) s)))))))
    

Formula

For all n >= 0, A000120(a(n)) = A160380(n).

A343230 A binary encoding of the digits "0" in balanced ternary representation of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 8, 9, 8, 10, 11, 10, 8, 9, 8, 12, 13, 12, 14, 15, 14, 12
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2021

Keywords

Comments

The ones in the binary representation of a(n) correspond to the nonleading digits "0" in the balanced ternary representation of n.
We can extend this sequence to negative indices: a(-n) = a(n) for any n >= 0.

Examples

			The first terms, alongside the balanced ternary representation of n (with "T" instead of digits "-1") and the binary representation of a(n), are:
  n   a(n)  ter(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     0       1          0
   2     0      1T          0
   3     1      10          1
   4     0      11          0
   5     0     1TT          0
   6     1     1T0          1
   7     0     1T1          0
   8     2     10T         10
   9     3     100         11
  10     2     101         10
  11     0     11T          0
  12     1     110          1
  13     0     111          0
  14     0    1TTT          0
  15     1    1TT0          1
		

Crossrefs

Cf. A059095, A140267, A291770, A343228, A343229, A343231, A147991 (indices of 0's).

Programs

  • PARI
    a(n) = { my (v=0, b=1, t); while (n, t=centerlift(Mod(n, 3)); if (t==0, v+=b); n=(n-t)\3; b*=2); v }

A305297 Restricted growth sequence transform of A292260, formed from 0-digits in ternary representation of A245612(n).

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 4, 1, 1, 3, 4, 2, 1, 5, 6, 7, 8, 2, 4, 8, 1, 9, 1, 2, 8, 10, 1, 1, 1, 11, 12, 1, 5, 13, 14, 15, 6, 4, 1, 7, 8, 16, 7, 9, 1, 17, 18, 19, 1, 8, 8, 3, 6, 17, 20, 4, 1, 17, 4, 3, 1, 21, 22, 23, 24, 25, 4, 26, 27, 1, 24, 28, 29, 9, 5, 4, 5, 13, 10, 30, 1, 31, 14, 13, 6, 32, 33, 6, 34, 15, 18, 4, 1, 35, 6, 31, 36, 1, 30, 36, 1, 37
Offset: 0

Views

Author

Antti Karttunen, May 31 2018

Keywords

Comments

For all i, j: a(i) = a(j) => A292261(i) = A292261(j).

Crossrefs

Cf. also A305296, A305298.
Cf. also A304750.

Programs

  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A048673(n) = (A003961(n)+1)/2;
    A254049(n) = A048673((2*n)-1);
    A245612(n) = if(n<2,1+n,if(!(n%2),(3*A245612(n/2))-1,A254049(A245612((n-1)/2))));
    A291770(n) = { my(s=0, b=1, d); while(n>2, if(!(n%3), s += b); b <<= 1; n \= 3); (s); };
    A292260(n) = A291770(A245612(n));
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    v305297 = rgs_transform(vector(65538,n,A292260(n-1)));
    A305297(n) = v305297[1+n];

A304750 Restricted growth sequence transform of A292240(n), formed from 0-digits in ternary representation of A254103(n).

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 4, 1, 1, 1, 1, 4, 1, 1, 1, 2, 5, 3, 4, 2, 1, 3, 4, 2, 1, 6, 7, 1, 1, 3, 4, 5, 1, 1, 1, 2, 8, 1, 1, 7, 5, 5, 5, 4, 1, 8, 8, 7, 5, 5, 5, 9, 1, 1, 1, 2, 10, 3, 4, 1, 1, 8, 8, 11, 5, 12, 13, 1, 1, 3, 4, 5, 1, 1, 1, 4, 14, 3, 4, 2, 1, 15, 16, 1, 8, 12, 13, 2, 8, 6, 7, 9, 1, 17, 18, 2, 14, 15, 16, 19, 8, 12
Offset: 0

Views

Author

Antti Karttunen, May 30 2018

Keywords

Comments

For all i, j: a(i) = a(j) => A292241(i) = A292241(j).

Crossrefs

Programs

  • PARI
    A254103(n) = if(!n,n,if(!(n%2),(3*A254103(n/2))-1,(3*(1+A254103((n-1)/2)))\2));
    A291770(n) = { my(s=0, b=1, d); while(n>2, if(!(n%3), s += b); b <<= 1; n \= 3); (s); };
    A292240(n) = A291770(A254103(n));
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    v304750 = rgs_transform(vector(65538,n,A292240(n-1)));
    A304750(n) = v304750[1+n];
Showing 1-9 of 9 results.