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 31-40 of 214 results. Next

A234613 Self-inverse permutation of nonnegative integers, "gray-blue" code: a(n) = A193231(A003188(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

Programs

Formula

a(n) = A193231(A003188(n)).
a(n) = A006068(A193231(n)).
a(n) = A193231(A234612(A193231(n))).

A265385 Sequence defined by a(1)=a(2)=1 and a(n) = gray(a(n-1) + a(n-2)), with gray(m) = A003188(m).

Original entry on oeis.org

1, 1, 3, 6, 13, 26, 52, 105, 211, 418, 847, 1673, 3380, 6755, 13404, 27104, 53538, 108163, 216183, 428935, 867329, 1713228, 3461227, 6917868, 13725948, 27754524, 54823316, 110759272, 221371778, 439230367, 888144817, 1754346232, 3544296957, 7083888783
Offset: 1

Views

Author

Stanislav Sykora, Dec 07 2015

Keywords

Comments

This recurrence is reminiscent of Fibonacci's, except that the result of each step is passed through the binary-reflected Gray code mapping, which introduces a degree of pseudo-randomness.
Conjecture: The mean growth rate r(n) = (a(2n)/a(n))^(1/n) appears to converge exactly to 2, with the consecutive-terms ratio s(n) = a(n)/a(n-1) exhibiting relatively small (~1%) but persistent fluctuations around the mean value. This contrasts what one might first expect, that sequence's growth rate were similar to that of the Fibonacci sequence, i.e., the golden ratio, since gray(m) just permutes every block of numbers ranging from 2^k to 2^l-1, for any 0

Examples

			r(10) = 2.000421531046..., r(1000) = 1.999999999903...
s(100) = 1.9841292..., s(101) = 2.0220518..., s(102) = 1.9752921...
s(10000) = 1.9841299..., s(10001) = 2.0220478..., s(10002) = 1.9752929...
		

Crossrefs

Programs

  • PARI
    gray(m)=bitxor(m,m>>1);
    a=vector(1000);a[1]=1;a[2]=1;for(n=3,#a,a[n]=gray(a[n-1]+a[n-2]));a

A265386 Sequence defined by a(1)=a(2)=1 and a(n) = gray(gray(a(n-1)) + gray(a(n-2))), with gray(m) = A003188(m).

Original entry on oeis.org

1, 1, 3, 2, 7, 4, 15, 9, 31, 19, 63, 39, 126, 79, 253, 158, 510, 315, 1012, 622, 2004, 1116, 4072, 2505, 8173, 5100, 16175, 10171, 32657, 20192, 64797, 39858, 128257, 71450, 260628, 160367, 523085, 326498, 1035105, 651126, 2090065, 1292517, 4146840
Offset: 1

Author

Stanislav Sykora, Dec 07 2015

Keywords

Comments

This recurrence is reminiscent of Fibonacci's, except that in each step the arguments as well as the result are passed through the binary-reflected Gray code mapping, which introduces a degree of pseudo-randomness.
Conjecture: the mean growth rate r(n) = (a(2n)/a(n))^(1/n) appears to converge to sqrt(2), with the consecutive-terms ratio s(n) = a(n)/a(n-1) exhibiting large and persistent fluctuations around the mean value.

Examples

			r(10) = 1.417436..., r(1000) = 1.414393...
s(100) = 0.629..., s(101) = 3.210..., s(102) = 0.618...
s(10000) = 0.631..., s(10001) = 3.183..., s(10002) = 0.608...
		

Crossrefs

Programs

  • PARI
    gray(m)=bitxor(m,m>>1);
    a=vector(1000);a[1]=1;a[2]=1;for(n=3,#a,a[n]=gray(gray(a[n-1])+gray(a[n-2])));a

A265387 Sequence defined by a(1)=a(2)=1 and a(n) = gray(a(n-1)) + gray(a(n-2)), with gray(m) = A003188(m).

Original entry on oeis.org

1, 1, 2, 4, 9, 19, 39, 78, 157, 316, 629, 1265, 2520, 5053, 10135, 20159, 40508, 80642, 161701, 324346, 645118, 1296264, 2580557, 5174455, 10379095, 20643816, 41480472, 82577840, 165582588, 332131050, 660602145, 1327375184, 2642491049, 5298643189
Offset: 1

Author

Stanislav Sykora, Dec 07 2015

Keywords

Comments

This recurrence is reminiscent of Fibonacci's, except that in each step the arguments are passed through the binary-reflected Gray code mapping, which introduces a degree of pseudo-randomness.
Conjecture: The mean growth rate r(n) = (a(2n)/a(n))^(1/n) appears to converge exactly to 2, with the consecutive-terms ratio s(n) = a(n)/a(n-1) exhibiting relatively small (~1%) but persistent fluctuations around the mean value. This contrasts what one might first expect, that sequence's growth rate were similar to that of the Fibonacci sequence, i.e., the golden ratio, since gray(m) just permutes every block of numbers ranging from 2^k to 2^l-1, for any 0

Examples

			r(10) = 2.000470476732..., r(1000) = 2.000000000203...
s(100) = 2.0058315..., s(101) = 1.9889791..., s(102) = 2.0093437...
s(10000) = 2.0058331..., s(10001) = 1.9889803..., s(10002) = 2.0093413...
		

Crossrefs

Programs

  • PARI
    gray(m)=bitxor(m,m>>1);
    a=vector(1000);a[1]=1;a[2]=1;for(n=3,#a,a[n]=gray(a[n-1])+gray(a[n-2]));a

A268719 Triangular table T(n>=0,k=0..n) = A003188(A006068(n) + A006068(k)), read by rows as A(0,0), A(1,0), A(1,1), A(2,0), A(2,1), A(2,2), ...

Original entry on oeis.org

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

Author

Antti Karttunen, Feb 13 2016

Keywords

Examples

			The first fifteen rows of the triangle:
                             0
                           1   3
                         2   6   5
                       3   2   7   6
                     4  12  15  13   9
                   5   4  13  12  11  10
                 6   7   4   5  14  15  12
               7   5  12   4  10  14  13  15
             8  24  27  25  29  31  26  30  17
           9   8  25  24  31  30  27  26  19  18
        10  11   8   9  26  27  24  25  22  23  20
      11   9  24   8  30  26  25  27  18  22  21  23
    12  13  14  15   8   9  10  11  28  29  30  31  24
  13  15  10  14  24   8  11   9  20  28  31  29  25  27
14  10   9  11  27  25   8  24  23  21  28  20  26  30  29
		

Crossrefs

Cf. A001477 (left edge), A001969 (right edge).
Cf. A268720 (row sums).

Programs

  • Mathematica
    a88[n_] := BitXor[n, Floor[n/2]];
    a68[n_] := BitXor @@ Table[Floor[n/2^m], {m, 0, Floor[Log[2, n]]}];
    a68[0] = 0;
    T[n_, k_] := a88[a68[n] + a68[k]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 19 2019 *)
  • Python
    def a003188(n): return n^(n>>1)
    def a006068(n):
        s=1
        while True:
            ns=n>>s
            if ns==0: break
            n=n^ns
            s<<=1
        return n
    def T(n, k): return a003188(a006068(n) + a006068(k))
    for n in range(21): print([T(n, k) for k in range(n + 1)]) # Indranil Ghosh, Jun 07 2017
  • Scheme
    (define (A268719 n) (A268715bi (A003056 n) (A002262 n)))
    

Formula

T(n,k) = A003188(A006068(n) + A006068(k)).
a(n) = A268715(A003056(n), A002262(n)). [As a linear sequence.]

A268720 Row sums of A268719: a(n) = Sum_{k=0..n} A003188(A006068(n)+A006068(k)).

Original entry on oeis.org

0, 4, 13, 18, 53, 55, 63, 80, 217, 217, 205, 244, 234, 264, 305, 328, 881, 877, 841, 916, 790, 864, 977, 988, 900, 956, 1021, 1070, 1197, 1235, 1267, 1344, 3553, 3541, 3457, 3604, 3310, 3456, 3681, 3684, 3100, 3244, 3453, 3478, 3917, 3931, 3883, 4048, 3528, 3636, 3757, 3850, 4021, 4111, 4199, 4320, 4745, 4817
Offset: 0

Author

Antti Karttunen, Feb 13 2016

Keywords

Crossrefs

Row sums of triangle A268719.

Programs

  • Scheme
    (define (A268720 n) (add (lambda (k) (A268715bi n k)) 0 n)) ;; Code for A268715bi given in A268715.
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))

Formula

a(n) = Sum_{k=0..n} A003188(A006068(n)+A006068(k)).

A268837 Antidiagonal sums of array A268715: a(n) = Sum_{k=0..n} A003188(A006068(n)+A006068(n-k)).

Original entry on oeis.org

0, 2, 7, 18, 17, 48, 56, 80, 67, 122, 136, 194, 204, 268, 281, 328, 291, 378, 396, 498, 510, 640, 675, 792, 790, 886, 965, 1098, 1093, 1208, 1248, 1344, 1227, 1378, 1356, 1530, 1538, 1792, 1815, 2016, 2008, 2218, 2339, 2602, 2619, 2892, 2970, 3208, 3150, 3294, 3385, 3586, 3691, 4012, 4174, 4440, 4367, 4554, 4644
Offset: 0

Author

Antti Karttunen, Feb 15 2016

Keywords

Crossrefs

Cf. also A268720, A268836.

Programs

  • Scheme
    (define (A268837 n) (add (lambda (k) (A003188 (+ (A006068 k) (A006068 (- n k))))) 0 n))
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))

Formula

a(n) = Sum_{k=0..n} A003188(A006068(n)+A006068(n-k)).

A277812 a(n) = the first odious number encountered when starting from k = n and iterating the map k -> A003188(A006068(k)/2).

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 7, 8, 4, 2, 11, 1, 13, 14, 7, 16, 8, 4, 19, 2, 21, 22, 11, 1, 25, 26, 13, 28, 14, 7, 31, 32, 16, 8, 35, 4, 37, 38, 19, 2, 41, 42, 21, 44, 22, 11, 47, 1, 49, 50, 25, 52, 26, 13, 55, 56, 28, 14, 59, 7, 61, 62, 31, 64, 32, 16, 67, 8, 69, 70, 35, 4, 73, 74, 37, 76, 38, 19, 79, 2, 81, 82, 41, 84, 42, 21, 87, 88, 44, 22, 91, 11, 93, 94, 47, 1, 97, 98, 49, 100
Offset: 1

Author

Antti Karttunen, Nov 03 2016

Keywords

Crossrefs

Cf. A277808 (gives the number of such iterations needed to reach a(n) from n).
Cf. A003945 (the positions of 1's in this sequence).

Formula

If A010060(n) = 1 [when n is one of the odious numbers, A000069], then a(n) = n, otherwise a(n) = a(A003188(A006068(n)/2)).
Other identities:
a(n) = A000069(A277813(n)).
If A010060(n) = 0 [when n is one of the evil numbers, A001969], then a(n)= a(A000265(n)) [the trailing zeros in binary expansion of n do not affect the result].
For all n >= 1, a(A000069(n)) = A000069(n). [By definition].
For all n > 1, a(A001969(n)) < A001969(n).

A286548 a(n) = A003188(n) - n.

Original entry on oeis.org

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

Author

Antti Karttunen, May 18 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A003188(n) - n.
a(n) = -A286546(A003188(n)). - Antti Karttunen, Oct 02 2017

A286549 Restricted growth sequence of A286548 (A003188(n) - n).

Original entry on oeis.org

1, 1, 2, 3, 4, 4, 3, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 14, 7, 16, 16, 5, 10, 17, 17, 18, 19, 20, 20, 21, 22, 23, 23, 22, 24, 25, 25, 26, 27, 28, 28, 29, 13, 30, 30, 11, 31, 32, 32, 31, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 42, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, 54, 53, 46, 55, 55, 44, 49, 56, 56, 27
Offset: 0

Author

Antti Karttunen, May 18 2017

Keywords

Crossrefs

Programs

  • PARI
    rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,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])); }
    A003188(n) = bitxor(n, n>>1);
    A286548(n) = (A003188(n)-n);
    write_to_bfile(0,rgs_transform(vector(65536,n,A286548(n-1))),"b286549.txt");
Previous Showing 31-40 of 214 results. Next