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 11-20 of 45 results. Next

A293226 Restricted growth sequence transform of A293225, a filter combining two products, the other formed from the 1-digits (A293221) and the other from the 2-digits (A293222) present in the ternary expansions of proper divisors of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 8, 2, 9, 10, 11, 2, 12, 2, 13, 14, 15, 2, 16, 4, 17, 18, 19, 2, 20, 2, 21, 22, 23, 24, 25, 2, 26, 27, 28, 2, 29, 2, 30, 31, 32, 2, 33, 34, 35, 12, 36, 2, 37, 38, 39, 40, 41, 2, 42, 2, 43, 44, 45, 46, 47, 2, 48, 49, 50, 2, 51, 2, 52, 53, 54, 55, 56, 2, 57, 58, 59, 2, 60, 61, 62, 63, 64, 2, 65, 66, 67, 68, 69, 70, 71, 2, 72
Offset: 1

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Comments

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

Crossrefs

Programs

  • PARI
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A289813(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==1, 1, 0)), 2); };
    A289814(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); };
    A293221(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289813(d)))); m; };
    A293222(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289814(d)))); m; };
    Anot_submitted(n) = (1/2)*(2 + ((A293222(n) + A293221(n))^2) - A293222(n) - 3*A293221(n)); \\ Eq.class-wise equal to A293225.
    write_to_bfile(1,rgs_transform(vector(19683,n,Anot_submitted(n))),"b293226.txt");

A290093 Compound filter (for base-3 digit runlengths): a(n) = P(A290091(n), A290092(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 3, 2, 3, 10, 5, 2, 5, 7, 3, 21, 5, 10, 36, 14, 5, 27, 12, 2, 5, 16, 5, 14, 23, 7, 12, 29, 3, 21, 5, 21, 78, 27, 5, 27, 12, 10, 78, 14, 36, 136, 44, 14, 90, 25, 5, 27, 23, 27, 90, 61, 12, 42, 38, 2, 5, 16, 5, 14, 23, 16, 23, 67, 5, 27, 23, 14, 44, 40, 23, 61, 80, 7, 12, 67, 12, 25, 80, 29, 38, 121, 3, 21, 5, 21, 78, 27, 5, 27, 12, 21, 465, 27, 78, 300, 90, 27
Offset: 0

Views

Author

Antti Karttunen, Jul 25 2017

Keywords

Comments

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

Crossrefs

Cf. A006047, A053735, A290079 (some of the matched sequences).

Programs

Formula

a(n) = (1/2)*(2 + ((A290091(n)+A290092(n))^2) - A290091(n) - 3*A290092(n)).

A304759 Binary encoding of 1-digits in ternary representation of A048673(n).

Original entry on oeis.org

1, 0, 2, 2, 3, 0, 0, 6, 7, 4, 1, 2, 4, 4, 0, 14, 5, 12, 6, 10, 9, 0, 4, 6, 1, 0, 4, 10, 5, 8, 1, 30, 8, 8, 14, 26, 2, 8, 13, 22, 3, 16, 0, 2, 17, 12, 8, 14, 1, 0, 10, 2, 10, 0, 9, 22, 3, 8, 11, 18, 9, 0, 18, 62, 0, 20, 12, 18, 1, 24, 13, 54, 15, 0, 28, 18, 0, 24, 12, 46, 37, 4, 8, 34, 7, 4, 0, 6, 11, 32, 23, 26, 22, 0
Offset: 1

Views

Author

Antti Karttunen, May 30 2018

Keywords

Comments

Compare the logarithmic scatterplot to those of A291759, A292250 and A304760.

Crossrefs

Cf. A048673, A289813, A304758 (rgs-transform), A340381.
Cf. A340376 (positions of zeros), A340378 (binary weight).

Programs

Formula

a(n) = A289813(A048673(n)).

A291770 A binary encoding of the zeros in ternary representation of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 11 2017

Keywords

Comments

The ones in the binary representation of a(n) correspond to the nonleading zeros in the ternary representation of n. For example: ternary(33) = 1020 and binary(a(33)) = 101 (a(33) = 5).

Examples

			   n      a(n)    ternary(n)  binary(a(n))
                  A007089(n)  A007088(a(n))
  --      ----    ----------  ------------
   1        0            1           0
   2        0            2           0
   3        1           10           1
   4        0           11           0
   5        0           12           0
   6        1           20           1
   7        0           21           0
   8        0           22           0
   9        3          100          11
  10        2          101          10
  11        2          102          10
  12        1          110           1
  13        0          111           0
  14        0          112           0
  15        1          120           1
  16        0          121           0
  17        0          122           0
  18        3          200          11
  19        2          201          10
  20        2          202          10
  21        1          210           1
  22        0          211           0
  23        0          212           0
  24        1          220           1
  25        0          221           0
  26        0          222           0
  27        7         1000         111
  28        6         1001         110
  29        6         1002         110
  30        5         1010         101
		

Crossrefs

Programs

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

Formula

For all n >= 0, a(A000244(n)) = A000225(n), that is, a(3^n) = (2^n) - 1. [The records in the sequence].
For all n >= 1, A000120(a(n)) = A077267(n).
For all n >= 1, A278222(a(n)) = A291771(n).

A293223 Restricted growth sequence transform of A293221, a product formed from the 1-digits present in the ternary expansion of proper divisors of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Crossrefs

Programs

  • PARI
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A289813(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From Remy Sigrist
    A293221(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289813(d)))); m; };
    write_to_bfile(1,rgs_transform(vector(19683,n,A293221(n))),"b293223.txt");

A244042 In ternary representation of n, replace 2's with 0's.

Original entry on oeis.org

0, 1, 0, 3, 4, 3, 0, 1, 0, 9, 10, 9, 12, 13, 12, 9, 10, 9, 0, 1, 0, 3, 4, 3, 0, 1, 0, 27, 28, 27, 30, 31, 30, 27, 28, 27, 36, 37, 36, 39, 40, 39, 36, 37, 36, 27, 28, 27, 30, 31, 30, 27, 28, 27, 0, 1, 0, 3, 4, 3, 0, 1, 0, 9, 10, 9, 12, 13, 12, 9, 10, 9
Offset: 0

Views

Author

Joonas Pohjonen, Jun 17 2014

Keywords

Examples

			16 = 121_3, replacing 2 with 0 gives 101_3 = 10, so a(16) = 10.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local t, r, i; t, r:= n, 0;
          for i from 0 while t>0 do
            r:= r+3^i*(d-> `if`(d=2, 0, d))(irem(t, 3, 't'))
          od; r
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, Jun 17 2014
  • Mathematica
    Array[FromDigits[IntegerDigits[#, 3] /. 2 -> 0, 3] &, 72, 0] (* Michael De Vlieger, Mar 17 2018 *)
  • PARI
    a(n) = my(d=digits(n, 3)); fromdigits(apply(x->(if (x==2, 0, x)), d), 3); \\ Michel Marcus, Jun 10 2017
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):return int("".join(map(str, digits(n, 3)[1:])).replace('2', '0'), 3) # Indranil Ghosh, Jun 10 2017
    

Formula

a(n) = n - 2 * A005836(A289814(n) + 1) = A005836(A289813(n) + 1). - Andrey Zabolotskiy, Nov 11 2019

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

Original entry on oeis.org

1, 2, 2, 5, 4, 4, 11, 4, 8, 17, 10, 18, 9, 8, 22, 17, 8, 8, 17, 22, 36, 41, 8, 42, 17, 16, 44, 21, 34, 32, 35, 20, 32, 33, 36, 64, 69, 18, 34, 73, 16, 74, 37, 44, 82, 33, 34, 34, 89, 16, 64, 69, 16, 68, 65, 34, 64, 33, 44, 64, 33, 72, 16, 65, 82, 68, 85, 16, 128, 137, 84, 72, 69, 34, 138, 145, 32, 84, 145, 88, 88, 149, 42, 162, 65, 68, 164, 45, 64
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n=1 (the termination value of the iteration), 1 is of the form 3k+1, thus a(1) = 1*(2^0) = 1.
For n=2, 2 is not of the form 3k+1, while A253889(2) = 1 is, thus a(2) = 0*(2^0) + 1*2(^1) = 2.
For n=4, 4 is of the form 3k+1, while A253889(4) = 2 is not, but then A253889(2) = 1 again is, thus a(4) = 1*(2^0) + 0*(2^1) + 1*(2^2) = 5.
		

Crossrefs

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; Map[FromDigits[#, 2] &[IntegerDigits[#, 3] /. 2 -> 0] &, Array[a, 98]] (* Michael De Vlieger, Sep 16 2017 *)

Formula

a(1) = 1; for n > 1, a(n) = 2*a(A253889(n)) + [n ≡ 1 (mod 3)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 3k+1, and 0 otherwise.
a(n) = A289813(A292243(n)).
Other identities. For all n >= 1:
a(A048673(n)) = A292248(n).
a(n) + A292244(n) = A064216(n).
a(n) AND A292244(n) = a(n) AND A292246(n) = 0, where AND is a bitwise-AND (A004198).

A304740 Restricted growth sequence transform of A304760(n), formed from 1-digits in ternary representation of A254103(n).

Original entry on oeis.org

1, 2, 1, 3, 3, 4, 1, 1, 5, 6, 6, 2, 3, 7, 6, 8, 9, 4, 1, 6, 10, 1, 1, 5, 5, 11, 11, 3, 10, 12, 12, 8, 13, 6, 6, 14, 3, 15, 11, 1, 16, 17, 12, 14, 3, 17, 12, 2, 9, 18, 19, 2, 20, 4, 1, 12, 16, 4, 1, 11, 21, 12, 12, 2, 22, 4, 1, 23, 10, 19, 19, 14, 5, 24, 24, 2, 20, 7, 6, 25, 26, 23, 23, 3, 21, 19, 19, 25, 5, 23, 23, 10, 21, 1, 1, 10, 13, 27, 27, 21, 28, 1, 1
Offset: 0

Views

Author

Antti Karttunen, May 29 2018

Keywords

Crossrefs

Cf. also A304746.

Programs

  • PARI
    A254103(n) = if(!n,n,if(!(n%2),(3*A254103(n/2))-1,(3*(1+A254103((n-1)/2)))\2));
    A289813(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From A289813
    A304760(n) = A289813(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; };
    v304740 = rgs_transform(vector(65538,n,A304760(n-1)));
    A304740(n) = v304740[1+n];

A292371 A binary encoding of 1-digits in the base-4 representation of n.

Original entry on oeis.org

0, 1, 0, 0, 2, 3, 2, 2, 0, 1, 0, 0, 0, 1, 0, 0, 4, 5, 4, 4, 6, 7, 6, 6, 4, 5, 4, 4, 4, 5, 4, 4, 0, 1, 0, 0, 2, 3, 2, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 3, 2, 2, 0, 1, 0, 0, 0, 1, 0, 0, 8, 9, 8, 8, 10, 11, 10, 10, 8, 9, 8, 8, 8, 9, 8, 8, 12, 13, 12, 12, 14, 15, 14, 14, 12, 13, 12, 12, 12, 13, 12, 12, 8, 9, 8, 8, 10, 11, 10, 10, 8, 9, 8, 8, 8, 9, 8, 8, 8
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        1          1           1
   2        0          2           0
   3        0          3           0
   4        2         10          10
   5        3         11          11
   6        2         12          10
   7        2         13          10
   8        0         20           0
   9        1         21           1
  10        0         22           0
  11        0         23           0
  12        0         30           0
  13        1         31           1
  14        0         32           0
  15        0         33           0
  16        4        100         100
  17        5        101         101
  18        4        102         100
		

Crossrefs

Cf. A289813 (analogous sequence for base 3).

Programs

  • Mathematica
    Table[FromDigits[IntegerDigits[n, 4] /. k_ /; IntegerQ@ k :> If[k == 1, 1, 0], 2], {n, 0, 112}] (* 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==1 else '0' for i in k), 2)
    print([a(n) for n in range(116)]) # Indranil Ghosh, Sep 21 2017
    
  • Python
    def A292371(n): return int(bin(n&~(n>>1))[:1:-2][::-1],2) # Chai Wah Wu, Jun 30 2022

Formula

a(n) = A059905(A292272(n)) = A059905(n AND A003188(n)), where AND is bitwise-AND (A004198).
For all n >= 0, A000120(a(n)) = A160381(n).

A293225 Compound filter: a(n) = P(A293224(n), A293223(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 2, 2, 5, 2, 8, 2, 12, 4, 13, 2, 32, 2, 40, 30, 33, 2, 59, 2, 58, 42, 69, 2, 143, 8, 80, 29, 83, 2, 178, 2, 197, 38, 96, 25, 239, 2, 100, 121, 163, 2, 221, 2, 202, 194, 103, 2, 448, 61, 365, 59, 245, 2, 333, 48, 576, 187, 256, 2, 720, 2, 278, 546, 718, 138, 606, 2, 503, 114, 1009, 2, 1101, 2, 437, 651, 678, 532, 831, 2, 1400, 172, 213, 2, 1508, 71, 500, 597
Offset: 1

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Crossrefs

Cf. A000027, A019565, A293221, A293222, A293223, A293224, A293226 (rgs-version of this filter).

Programs

  • PARI
    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; };
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A289813(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==1, 1, 0)), 2); };
    A289814(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); };
    A293221(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289813(d)))); m; };
    A293222(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289814(d)))); m; };
    v293223 = rgs_transform(vector(19683,n,A293221(n)));
    A293223(n) = v293223[n];
    v293224 = rgs_transform(vector(19683,n,A293222(n)));
    A293224(n) = v293224[n];
    A293225(n) = (1/2)*(2 + ((A293224(n) + A293223(n))^2) - A293224(n) - 3*A293223(n));
    
  • Scheme
    (define (A293225 n) (* 1/2 (+ (expt (+ (A293224 n) (A293223 n)) 2) (- (A293224 n)) (- (* 3 (A293223 n))) 2)))

Formula

a(n) = (1/2)*(2 + ((A293224(n) + A293223(n))^2) - A293224(n) - 3*A293223(n)).
Previous Showing 11-20 of 45 results. Next