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

A258996 Permutation of the positive integers: this permutation transforms the enumeration system of positive irreducible fractions A002487/A002487' (Calkin-Wilf) into the enumeration system A162911/A162912 (Drib), and vice versa.

Original entry on oeis.org

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

Views

Author

Yosu Yurramendi, Jun 16 2015

Keywords

Comments

As A258746 the permutation is self-inverse. Except for fixed points 1, 2, 3 it consists completely of 2-cycles: (4,6), (5,7), (8,10), (9,11), (12,14), (13,15), (16,26), (17,27), ..., (21,31), ..., (32,42), ... . - Yosu Yurramendi, Mar 31 2016
When terms of sequence |n - a(n)|/2 (n > 3) are considered only once, and they are sorted in increasing order, A147992 is obtained. - Yosu Yurramendi, Apr 05 2016

Crossrefs

Cf. A092569, A117120, A258746. Similar R-programs: A332769, A284447.

Programs

  • R
    maxlevel <- 5 # by choice
    a <- 1
    for(m in 0:maxlevel) for(k in 0:(2^m-1)){
      a[2^(m+1) + 2*k    ] = 2*a[2^(m+1) - 1 - k]
      a[2^(m+1) + 2*k + 1] = 2*a[2^(m+1) - 1 - k] + 1}
    a
    
  • R
    # Given n, compute a(n) by taking into account the binary representation of n
    maxblock <- 7 # by choice
    a <- 1:3
    for(n in 4:2^maxblock){
      ones <- which(as.integer(intToBits(n)) == 1)
      nbit <- as.integer(intToBits(n))[1:tail(ones, n = 1)]
      anbit <- nbit
      anbit[seq(2, length(anbit) - 1, 2)] <- 1 - anbit[seq(2, length(anbit) - 1, 2)]
      a <- c(a, sum(anbit*2^(0:(length(anbit) - 1))))
    }
    a
    # Yosu Yurramendi, Mar 30 2021

Formula

a(1) = 1, a(2) = 2, a(3) = 3. For n = 2^m + k, m > 1, 0 <= k < 2^m. If m is even, then a(2^(m+1)+k) = a(2^m + k) + 2^m and a(2^(m+1) + 2^m+k) = a(2^m+k) + 2^(m+1). If m is odd, then a(2^(m+1) + k) = a(2^m+k) + 2^(m+1) and a(2^(m+1) + 2^m+k) = a(2^m+k) + 2^m.
From Yosu Yurramendi, Mar 23 2017: (Start)
A258746(a(n)) = a(A258746(n)), n > 0.
A092569(a(n)) = a(A092569(n)), n > 0.
A117120(a(n)) = a(A117120(n)), n > 0;
A065190(a(n)) = a(A065190(n)), n > 0;
A054429(a(n)) = a(A054429(n)), n > 0;
A063946(a(n)) = a(A063946(n)), n > 0. (End)
a(1) = 1, for m >= 0 and 0 <= k < 2^m, a(2^(m+1) + 2*k) = 2*a(2^(m+1) - 1 - k), a(2^(m+1) + 2*k + 1) = 2*a(2^(m+1) - 1 - k) + 1. - Yosu Yurramendi, May 23 2020
a(n) = A020988(A102572(n)) XOR n. - Alan Michael Gómez Calderón, Mar 11 2025

A360099 To get A(n,k), replace 0's in the binary expansion of n with (-1) and interpret the result in base k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 1, 0, 1, -1, 0, 1, 0, 1, 0, 1, 1, 2, -1, 0, 1, 2, 3, -1, 1, 0, 1, 3, 4, 1, 1, -1, 0, 1, 4, 5, 5, 3, 1, 1, 0, 1, 5, 6, 11, 7, 5, 3, -1, 0, 1, 6, 7, 19, 13, 11, 7, -2, 1, 0, 1, 7, 8, 29, 21, 19, 13, 1, 0, -1, 0, 1, 8, 9, 41, 31, 29, 21, 14, 3, 0, 1, 0, 1, 9, 10, 55, 43, 41, 31, 43, 16, 5, 2, -1
Offset: 0

Views

Author

Alois P. Heinz, Jan 25 2023

Keywords

Comments

The empty bit string is used as binary expansion of 0, so A(0,k) = 0.

Examples

			Square array A(n,k) begins:
   0,  0, 0,  0,  0,   0,   0,   0,   0,   0,   0, ...
   1,  1, 1,  1,  1,   1,   1,   1,   1,   1,   1, ...
  -1,  0, 1,  2,  3,   4,   5,   6,   7,   8,   9, ...
   1,  2, 3,  4,  5,   6,   7,   8,   9,  10,  11, ...
  -1, -1, 1,  5, 11,  19,  29,  41,  55,  71,  89, ...
   1,  1, 3,  7, 13,  21,  31,  43,  57,  73,  91, ...
  -1,  1, 5, 11, 19,  29,  41,  55,  71,  89, 109, ...
   1,  3, 7, 13, 21,  31,  43,  57,  73,  91, 111, ...
  -1, -2, 1, 14, 43,  94, 173, 286, 439, 638, 889, ...
   1,  0, 3, 16, 45,  96, 175, 288, 441, 640, 891, ...
  -1,  0, 5, 20, 51, 104, 185, 300, 455, 656, 909, ...
		

Crossrefs

Columns k=0-6, 10 give: A062157, A145037, A006257, A147991, A147992, A153777, A147993, A359925.
Rows n=0-10 give: A000004, A000012, A023443, A000027(k+1), A165900, A002061, A165900(k+1), A002061(k+1), A083074, A152618, A062158.
Main diagonal gives A360096.

Programs

  • Maple
    A:= proc(n, k) option remember; local m;
         `if`(n=0, 0, k*A(iquo(n, 2, 'm'), k)+2*m-1)
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..12);
    # second Maple program:
    A:= (n, k)-> (l-> add((2*l[i]-1)*k^(i-1), i=1..nops(l)))(Bits[Split](n)):
    seq(seq(A(n, d-n), n=0..d), d=0..12);

Formula

G.f. for column k satisfies g_k(x) = k*(x+1)*g_k(x^2) + x/(1+x).
A(n,k) = k*A(floor(n/2),k)+2*(n mod 2)-1 for n>0, A(0,k)=0.
A(n,k) mod 2 = A057427(n) if k is even.
A(n,k) mod 2 = A030300(n) if k is odd and n>=1.
A(2^(n+1),1) + n = 0.

A153775 Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x are in S.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 14, 15, 17, 18, 23, 24, 26, 27, 41, 42, 44, 45, 50, 51, 53, 54, 68, 69, 71, 72, 77, 78, 80, 81, 122, 123, 125, 126, 131, 132, 134, 135, 149, 150, 152, 153, 158, 159, 161, 162, 203, 204, 206, 207, 212, 213, 215, 216, 230, 231, 233, 234, 239, 240, 242
Offset: 1

Views

Author

Clark Kimberling, Jan 02 2009

Keywords

Comments

Subsequences include A007051, A000244, A153773, A153774.
First generation: 1
2nd generation: 2, 3
3rd generation: 5, 6, 8, 9
4th generation: 14, 15, 17, 18, 23, 24, 26, 27
Does every generation contain a prime?
From Peter Munn, Feb 10 2022: (Start)
Consider a Sierpinski arrowhead curve formed of edges indexed consecutively from 0 at its axis of symmetry and aligned with an infinite Sierpinski gasket so that each edge is contained in the boundary of either the plane sector occupied by the gasket or a triangular region of the gasket's complement. The numbers {4*a(n)-1 : n >= 1} (that is, 3, 7, 11, 19, 23, 31, 35, 55, 59, ...) index the edges that are contained in the boundaries of certain triangular regions: each is the first region encountered of each successively larger size that does not lie across the axis of symmetry.
Let S be the set of terms. Define c: N -> P(R) so that c(m) is the scaled and translated Cantor ternary set spanning [m-0.5, m], and let C be the union of c(m) for all m in S. C is the closure under multiplication by 3 of the scaled and translated Cantor ternary set spanning [0.5, 1.0].
(End)
Positive numbers whose balanced ternary expansions contain exactly one digit 1. - Rémy Sigrist, May 08 2022

Crossrefs

See also the related sequences listed in A191106.

Programs

  • Mathematica
    nxt[n_] := Flatten[3 # + {-1, 0} & /@ n]; Union[Flatten[NestList[nxt,{1},5]]] (* G. C. Greubel, Aug 28 2016 *)

Formula

From Peter Munn, Feb 04 2022: (Start)
For k >= 0, 2^k <= n <= 2^(k+1)-1, a(n) = A005836(n+1) - (3^k-1)/2.
For n >= 1, A307744(4*a(2n)-1) = A307744(4*a(2n+1)-1) = A307744(4*a(n)-1) + 1.
(End)

A147985 Coefficients of numerator polynomials S(n,x) associated with reciprocation.

Original entry on oeis.org

1, 0, 1, 0, -1, 1, 0, -3, 0, 1, 1, 0, -7, 0, 13, 0, -7, 0, 1, 1, 0, -15, 0, 83, 0, -220, 0, 303, 0, -220, 0, 83, 0, -15, 0, 1, 1, 0, -31, 0, 413, 0, -3141, 0, 15261, 0, -50187, 0, 115410, 0, -189036, 0, 222621, 0, -189036, 0, 115410, 0, -50187, 0, 15261, 0, -3141, 0, 413, 0
Offset: 1

Views

Author

Clark Kimberling, Nov 24 2008

Keywords

Comments

1. S(n)=U(n-1)V(n-1) where U(n-1)=S(n-1)+S(1)*S(2)*...*S(n-2) and V(n-1)=S(n-1)-S(1)*S(2)*...*S(n-2), for n>=2. If U(n) and V(n) are written as polynomials U(n,x) and V(n,x), then V(n,x)=U(n,-x). See A147989 for coefficients of U(n).
2. S(n)=S(n-1)^2+S(n-1)*S(n-2)^2-S(n-2)^4 for n>2. (The Gorskov-Wirsting polynomials also have this recurrence; see H. L. Montgomery, Ten Lectures on the Interface between Analytic Number Theory and Harmonic Analysis, CBMS Regional Conference Series in Mathematics, 84, AMS, pp. 183-190.)
3. For n>0, the 2^(n-1) zeros of S(n) are real. If r is a zero of S(n), then -r and 1/r are zeros of S(n).
4. If r is a zero of S(n), then the numbers z satisfying r=z-1/z and r=z+1/z are zeros of S(n+1).
5. If n>2, then S(n,1)=1 and S(n,2)=A127814(n).
6. S(n,2^(1/2))=-1 for n>2 and S(n,2^(-1/2))=-2^(1-n) for n>1.

Examples

			S(1)=x
S(2)=x^2-1=(x-1)(x+1)
S(3)=x^4-3*x^2+1=(x^2+x-1)(x^2-x-1)
S(4)=x^8-7*x^6+13*x^4-7*x^2+1=(x^4+x^3-3*x^2-x+1)(x^4-x^3-3*x^2+x+1),
so that, as an array, sequence begins with
1 0
1 0 -1
1 0 -3 0 1
1 0 -7 0 13 0 -7 0 1
		

Crossrefs

Programs

  • Mathematica
    s[1] = x; t[1] = 1; s[n_] := s[n] = s[n-1]^2 - t[n-1]^2; t[n_] := t[n] = s[n-1]*t[n-1]; row[n_] := CoefficientList[s[n], x] // Reverse; Table[row[n], {n, 1, 7}] // Flatten (* Jean-François Alcover, Apr 22 2013 *)

Formula

The basic idea is to iterate the reciprocation-difference mapping x/y -> x/y-y/x.
Let x be an indeterminate, S(1)=x, T(1)=1 and for n>1, define S(n)=S(n-1)^2-T(n-1)^2 and T(n)=S(n-1)*T(n-1), so that S(n)/T(n)=S(n-1)/T(n-1)-T(n-1)/S(n-1).

A147986 Coefficients of denominator polynomials T(n,x) associated with reciprocation.

Original entry on oeis.org

1, 1, 0, 1, 0, -1, 0, 1, 0, -4, 0, 4, 0, -1, 0, 1, 0, -11, 0, 45, 0, -88, 0, 88, 0, -45, 0, 11, 0, -1, 0, 1, 0, -26, 0, 293, 0, -1896, 0, 7866, 0, -22122, 0, 43488, 0, -60753, 0, 60753, 0, -43488, 0, 22122, 0, -7866, 0, 1896, 0, -293, 0, 26, 0, -1, 0, 1, 0, -57, 0, 1512, 0
Offset: 1

Views

Author

Clark Kimberling, Nov 24 2008

Keywords

Comments

T(n)=S(1)*S(2)*...*S(n-1). The degree of S(n) in x is m=2^(n-1), so that the degree of T(n) is m-1. Write the zeros of T(n) as r(1)

Examples

			T(1) = 1
T(2) = x
T(3) = x^3-x
T(4) = x^7-4*x^5+4*x^3-x
so that, as an array, the sequence begins with:
1
1 0
1 0 -1 0
1 0 -4 0 4 0 -1 0
		

Programs

  • Mathematica
    s[1] = x; t[1] = 1; s[n_] := s[n] = s[n-1]^2 - t[n-1]^2; t[n_] := t[n] = s[n-1]*t[n-1]; row[n_] := CoefficientList[t[n], x] // Reverse; Table[row[n], {n, 7}] // Flatten (* Jean-François Alcover, Apr 22 2013 *)

Formula

The basic idea is to iterate the reciprocation-difference mapping x/y -> x/y-y/x.
Let x be an indeterminate, S(1)=x, T(1)=1 and for n>1, define S(n)=S(n-1)^2-T(n-1)^2 and T(n)=S(n-1)*T(n-1), so that S(n)/T(n)=S(n-1)/T(n-1)-T(n-1)/S(n-1).

A147989 Coefficients of factor polynomials U(n,x) associated with reciprocation.

Original entry on oeis.org

1, 1, -1, 1, 1, -3, -1, 1, 1, 1, -7, -4, 13, 4, -7, -1, 1, 1, 1, -15, -11, 83, 45, -220, -88, 303, 88, -220, -45, 83, 11, -15, -1, 1, 1, 1, -31, -26, 413, 293, -3141, -1896, 15261, 7866, -50187, -22122, 115410, 43488, -189036, -60753, 222621, 60753, -189036
Offset: 1

Author

Clark Kimberling, Nov 25 2008

Keywords

Comments

The zeros of U(n,x) and U(n,-x) are the zeros of S(n,x) at A147985.

Examples

			U(3) = x^2+x-1;
U(4) = x^4+x^3-3*x^2-x+1;
U(5) = x^8+x^7-7*x^6-4*x^5+13*x^4+4*x^3-7*x^2-x+1;
so that, as an array, the sequence begins with:
1 1 -1
1 1 -3 -1 1
1 1 -7 -4 13 4 -7 -1 1
		

Programs

  • Maple
    U[3]:= x^2+x-1:
    U[4]:= x^4+x^3-3*x^2-x+1:
    for n from 5 to 10 do
      U[n]:= normal(U[n-1]*M(U[n-1]) + x*(x^2-1)*mul(U[i]*M(U[i]),i=3..n-2));
    od:
    seq(seq(coeff(U[m],x,j),j=degree(U[m])..0,-1),m=3..10); # Robert Israel, Jun 30 2015
  • Mathematica
    U[3, x_] = x^2 + x - 1;
    U[4, x_] = x^4 + x^3 - 3 x^2 - x + 1;
    U[n_, x_] := U[n, x] = U[n-1, x] U[n-1, -x] + x (x^2 - 1) Product[U[k, x] U[k, -x], {k, 3, n-2}];
    Table[CoefficientList[U[n, x], x] // Reverse, {n, 3, 7}] // Flatten (* Jean-François Alcover, Mar 25 2019 *)

Formula

For n>=5, U(n)=U(n,x)=U(n-1,x)*U(n-1,-x)+x*(x^2-1)*U(3,x)*U(3,-x)*U(4,x)*U(4,-x)*...*U(n-2,x)*U(n-2,-x), where U(3)=x^2+x-1, U(4)=x^4+x^3-3*x^2-x+1.

A147990 Array A147985 (Polynomial coefficients) with zeros deleted.

Original entry on oeis.org

1, 1, -1, 1, -3, 1, 1, -7, 13, -7, 1, 1, -15, 83, -220, 303, -220, 83, -15, 1, 1, -31, 413, -3141, 15261, -50187, 115410, -189036, 222621, -189036, 115410, -50187, 15261, -3141, 413, -31, 1, 1, -63, 1839, -33150, 414861, -3841195, 27378213, -154299168
Offset: 1

Author

Clark Kimberling, Nov 25 2008

Keywords

Examples

			s(1)=x
s(2)=S(2,y)=x-1
s(3)=S(3,y)=x^2-3*x+1
s(4)=S(4,y)=x^4-7*x^3+13*x^2-7*x+1
so that as an array A147990 begins with
1
1 -1
1 -3 1
1 -7 13 -7 1
		

Formula

Let s(1)=x and for n>=2, let s(n)=s(n,x)=S(n,y), where y=x^(1/2) and S(n,x)
is as at A147985. Then A147990 gives the coefficients of the polynomials s(n).

A147987 Coefficients of numerator polynomials P(n,x) associated with reciprocation.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 3, 0, 1, 1, 0, 7, 0, 13, 0, 7, 0, 1, 1, 0, 15, 0, 83, 0, 220, 0, 303, 0, 220, 0, 83, 0, 15, 0, 1, 1, 0, 31, 0, 413, 0, 3141, 0, 15261, 0, 50187, 0, 115410, 0, 189036, 0, 222621, 0, 189036, 0, 115410, 0, 50187, 0, 15261, 0, 3141, 0, 413, 0, 31, 0, 1, 1, 0, 63
Offset: 1

Author

Clark Kimberling, Nov 24 2008

Keywords

Comments

1. P(n,1)=A073833(n) for n>=1; P(n,2)=A073833(n+1) for n>=0.
2. P(n)=P(n-1)^2+P(n-1)*P(n-2)^2-P(n-2)^4 for n>=3.
3. For n>=3, P(n)=P(n,x)=S(n,i*x), where S(n) is the polynomial at A147985.
Thus all the zeros of P(n,x), for n>=2, are nonreal.

Examples

			P(1) = x
P(2) = x^2+1
P(3) = x^4+3*x^2+1
P(4) = x^8+7*x^6+13*x^4+7x^2+1
so that, as an array, the sequence begins with:
1 0
1 0 1
1 0 3 0 1
1 0 7 0 13 0 7 0 1
		

Programs

  • Mathematica
    p[1] = x; q[1] = 1; p[n_] := p[n] = p[n-1]^2 + q[n-1]^2; q[n_] := q[n] = p[n-1]*q[n-1]; row[n_] := CoefficientList[p[n], x] // Reverse; Table[row[n], {n, 1, 7}] // Flatten (* Jean-François Alcover, Apr 22 2013 *)

Formula

The basic idea is to iterate the reciprocation-sum mapping x/y -> x/y+y/x.
Let x be an indeterminate, P(1)=x, Q(1)=1 and for n>1, define P(n)=P(n-1)^2+Q(n-1)^2 and Q(n)=P(n-1)*Q(n-1), so that P(n)/Q(n)=P(n-1)/Q(n-1)-Q(n-1)/P(n-1).

A147988 Coefficients of denominator polynomials Q(n,x) associated with reciprocation.

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 0, 1, 0, 4, 0, 4, 0, 1, 0, 1, 0, 11, 0, 45, 0, 88, 0, 88, 0, 45, 0, 11, 0, 1, 0, 1, 0, 26, 0, 293, 0, 1896, 0, 7866, 0, 22122, 0, 43488, 0, 60753, 0, 60753, 0, 43488, 0, 22122, 0, 7866, 0, 1896, 0, 293, 0, 26, 0, 1, 0, 1, 0, 57, 0, 1512, 0, 24858, 0, 284578, 0
Offset: 1

Author

Clark Kimberling, Nov 24 2008

Keywords

Comments

1. Q(n,1)=A073834(n) for n>=1.
2. For n>=3, Q(n)=Q(n,x)=i*T(n,i*x), where T(n) is the polynomial at A147986.
Thus all the zeros of Q(n,x), for n>=2, are nonreal.

Examples

			Q(1) = 1
Q(2) = x
Q(3) = x^3+x
Q(4) = x^7+4*x^5+4*x^3+1
so that, as an array, the sequence begins with:
1
1 0
1 0 1 0
1 0 4 0 4 0 1
		

Formula

The basic idea is to iterate the reciprocation-sum mapping x/y -> x/y+y/x.
Let x be an indeterminate, P(1)=x, Q(1)=1 and for n>1, define P(n)=P(n-1)^2+Q(n-1)^2 and Q(n)=P(n-1)*Q(n-1), so that P(n)/Q(n)=P(n-1)/Q(n-1)-Q(n-1)/P(n-1).

A359925 Numbers with easy multiplication table - the first 9 multiples of these numbers can be derived by either incrementing or decrementing the corresponding digits from the previous multiple.

Original entry on oeis.org

1, 9, 11, 89, 91, 109, 111, 889, 891, 909, 911, 1089, 1091, 1109, 1111, 8889, 8891, 8909, 8911, 9089, 9091, 9109, 9111, 10889, 10891, 10909, 10911, 11089, 11091, 11109, 11111, 88889, 88891, 88909, 88911, 89089, 89091, 89109, 89111, 90889, 90891, 90909, 90911
Offset: 1

Author

Kiran Ananthpur Bacche, Jan 25 2023

Keywords

Comments

This is also the list of numbers having exactly one dot or one antidot in each box in the Decimal Exploding Dots notation.

Examples

			a(4) = 89. The first nine multiples of 89 are {089, 178, 267, 356, 445, 534, 623, 712, 801}. The digits in the hundreds place increment by 1, while the digits in the tens and units place decrement by 1. In the Decimal Exploding Dots notation, 89 is represented as DOT-ANTIDOT-ANTIDOT = 100 - 10 - 1 = 89
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n=0, 0, 10*a(iquo(n, 2, 'm'))+2*m-1)
        end:
    seq(a(n), n=1..44);   # Alois P. Heinz, Jan 25 2023

Formula

a(n) = 10*a(floor(n/2))+2*(n mod 2)-1 for n>0, a(0)=0. - Alois P. Heinz, Jan 25 2023
a(n) = 2*A256290(n-1) + 1 for n>1. - Hugo Pfoertner, Jan 28 2023
Showing 1-10 of 10 results.