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

A255558 Inverse permutation to A255557.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 6, 9, 11, 8, 12, 16, 22, 29, 10, 14, 37, 17, 13, 46, 56, 18, 23, 67, 30, 38, 79, 92, 106, 121, 15, 20, 137, 47, 24, 154, 172, 19, 57, 191, 68, 25, 211, 232, 254, 31, 80, 277, 39, 48, 301, 326, 93, 107, 352, 122, 138, 379, 407, 436, 466, 497, 21, 27, 529, 155, 58, 562, 596, 32, 173, 631, 192, 26
Offset: 1

Views

Author

Antti Karttunen, Apr 14 2015

Keywords

Crossrefs

Inverse permutation: A255557.

Programs

  • Scheme
    (define (A255558 n) (let ((row (A255559 n)) (col (A255560 n))) (* (/ 1 2) (- (expt (+ row col) 2) row col col col -2))))

Formula

a(n) = (1/2) * ((c+r)^2 - r - 3*c + 2), where r = A255559(n), and c = A255560(n).

A055938 Integers not generated by b(n) = b(floor(n/2)) + n (complement of A005187).

Original entry on oeis.org

2, 5, 6, 9, 12, 13, 14, 17, 20, 21, 24, 27, 28, 29, 30, 33, 36, 37, 40, 43, 44, 45, 48, 51, 52, 55, 58, 59, 60, 61, 62, 65, 68, 69, 72, 75, 76, 77, 80, 83, 84, 87, 90, 91, 92, 93, 96, 99, 100, 103, 106, 107, 108, 111, 114, 115, 118, 121, 122, 123, 124, 125, 126, 129
Offset: 1

Views

Author

Alford Arnold, Jul 21 2000

Keywords

Comments

Note that the lengths of the consecutive runs in a(n) form sequence A001511.
Integers that are not a sum of distinct integers of the form 2^k-1. - Vladeta Jovovic, Jan 24 2003
Also n! never ends in this many 0's in base 2 - Carl R. White, Jan 21 2008
A079559(a(n)) = 0. - Reinhard Zumkeller, Mar 18 2009
These numbers are dead-end points when trying to apply the iterated process depicted in A071542 in reverse, i.e. these are positive integers i such that there does not exist k with A000120(i+k)=k. See also comments at A179016. - Antti Karttunen, Oct 26 2012
Conjecture: a(n)=b(n) defined as b(1)=2, for n>1, b(n+1)=b(n)+1 if n is already in the sequence, b(n+1)=b(n)+3 otherwise. If so, then see Cloitre comment in A080578. - Ralf Stephan, Dec 27 2013
Numbers n for which A257265(m) = 0. - Reinhard Zumkeller, May 06 2015. Typo corrected by Antti Karttunen, Aug 08 2015
Numbers which have a 2 in their skew-binary representation (cf. A169683). - Allan C. Wechsler, Feb 28 2025

Examples

			Since A005187 begins 0 1 3 4 7 8 10 11 15 16 18 19 22 23 25 26 31... this sequence begins 2 5 6 9 12 13 14 17 20 21
		

Crossrefs

Complement of A005187. Setwise difference of A213713 and A213717.
Row 1 of arrays A257264, A256997 and also of A255557 (when prepended with 1). Equally: column 1 of A256995 and A255555.
Cf. also arrays A254105, A254107 and permutations A233276, A233278.
Left inverses: A234017, A256992.
Gives positions of zeros in A213714, A213723, A213724, A213731, A257265, positions of ones in A213725-A213727 and A256989, positions of nonzeros in A254110.
Cf. also A010061 (integers that are not a sum of distinct integers of the form 2^k+1).
Analogous sequence for factorial base number system: A219658, for Fibonacci number system: A219638, for base-3: A096346. Cf. also A136767-A136774.

Programs

  • Haskell
    a055938 n = a055938_list !! (n-1)
    a055938_list = concat $
       zipWith (\u v -> [u+1..v-1]) a005187_list $ tail a005187_list
    -- Reinhard Zumkeller, Nov 07 2011
    
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_Integer] := a[Floor[n/2]] + n; b = {}; Do[ b = Append[b, a[n]], {n, 0, 105}]; c =Table[n, {n, 0, 200}]; Complement[c, b]
    (* Second program: *)
    t = Table[IntegerExponent[(2n)!, 2], {n, 0, 100}]; Complement[Range[t // Last], t] (* Jean-François Alcover, Nov 15 2016 *)
  • PARI
    L=listcreate();for(n=1,1000,for(k=2*n-hammingweight(n)+1,2*n+1-hammingweight(n+1),listput(L,k)));Vec(L) \\ Ralf Stephan, Dec 27 2013
    
  • Python
    def a053644(n): return 0 if n==0 else 2**(len(bin(n)[2:]) - 1)
    def a043545(n):
        x=bin(n)[2:]
        return int(max(x)) - int(min(x))
    def a079559(n): return 1 if n==0 else a043545(n + 1)*a079559(n + 1 - a053644(n + 1))
    print([n for n in range(1, 201) if a079559(n)==0]) # Indranil Ghosh, Jun 11 2017, after the comment by Reinhard Zumkeller
  • Scheme
    ;; utilizing COMPLEMENT-macro from Antti Karttunen's IntSeq-library)
    (define A055938 (COMPLEMENT 1 A005187))
    ;; Antti Karttunen, Aug 08 2015
    

Formula

a(n) = A080578(n+1) - 2 = A080468(n+1) + 2*n (conjectured). - Ralf Stephan, Dec 27 2013
From Antti Karttunen, Aug 08 2015: (Start)
Other identities. For all n >= 1:
A234017(a(n)) = n.
A256992(a(n)) = n.
A257126(n) = a(n) - A005187(n).
(End)

Extensions

More terms from Robert G. Wilson v, Jul 24 2000

A233276 a(0)=0, a(1)=1, after which a(2n) = A005187(1+a(n)), a(2n+1) = A055938(a(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 18 2013

Keywords

Comments

For all n, a(A000079(n)) = A000225(n+1), i.e. a(2^n) = (2^(n+1))-1.
For n>=1, a(A000225(n)) = A000325(n).
This permutation is obtained by "entangling" even and odd numbers with complementary pair A005187 & A055938, meaning that it can be viewed as a binary tree. Each child to the left is obtained by applying A005187(n+1) to the parent node containing n, and each child to the right is obtained as A055938(n):
0
|
...................1...................
3 2
7......../ \........6 4......../ \........5
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
15 14 11 13 8 9 10 12
31 30 26 29 22 24 25 28 16 17 18 20 19 21 23 27
etc.
For n >= 1, A256991(n) gives the contents of the immediate parent node of the node containing n, while A070939(n) gives the total distance to 0 from the node containing n, with A256478(n) telling how many of the terms encountered on that journey are terms of A005187 (including the penultimate 1 but not the final 0 in the count), while A256479(n) tells how many of them are terms of A055938.
Permutation A233278 gives the mirror image of the same tree.

Crossrefs

Inverse permutation: A233275.
Cf. also A070939 (the binary width of both n and a(n)).
Related arrays: A255555, A255557.
Similarly constructed permutation pairs: A005940/A156552, A135141/A227413, A232751/A232752, A233277/A233278, A233279/A233280, A003188/A006068.

Formula

a(0)=0, a(1)=1, and thereafter, a(2n) = A005187(1+a(n)), a(2n+1) = A055938(a(n)).
As a composition of related permutations:
a(n) = A233278(A054429(n)).

Extensions

Name changed and the illustration of binary tree added by Antti Karttunen, Apr 19 2015

A233278 a(0)=0, a(1)=1, after which a(2n) = A055938(a(n)), a(2n+1) = A005187(1+a(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 18 2013

Keywords

Comments

This permutation is obtained by "entangling" even and odd numbers with complementary pair A055938 & A005187, meaning that it can be viewed as a binary tree. Each child to the left is obtained by applying A055938(n) to the parent node containing n, and each child to the right is obtained as A005187(n+1):
0
|
...................1...................
2 3
5......../ \........4 6......../ \........7
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
12 10 9 8 13 11 14 15
27 23 21 19 20 18 17 16 28 25 24 22 29 26 30 31
etc.
For n >= 1, A256991(n) gives the contents of the immediate parent node of the node containing n, while A070939(n) gives the total distance to zero at the root from the node containing n, with A256478(n) telling how many of the terms encountered on that journey are terms of A005187 (including the penultimate 1 but not the final 0 in the count), while A256479(n) tells how many of them are terms of A055938.
Permutation A233276 gives the mirror image of the same tree.

Crossrefs

Inverse permutation: A233277.
Cf. also A070939 (the binary width of both n and a(n)).
Related arrays: A255555, A255557.
Similarly constructed permutation pairs: A005940/A156552, A135141/A227413, A232751/A232752, A233275/A233276, A233279/A233280, A003188/A006068.

Formula

a(0)=0, a(1)=1, and thereafter, a(2n) = A055938(a(n)), a(2n+1) = A005187(1+a(n)).
As a composition of related permutations:
a(n) = A233276(A054429(n)).

Extensions

Name changed and the illustration of binary tree added by Antti Karttunen, Apr 19 2015

A256997 Square array A(row,col) read by antidiagonals: A(1,col) = A055938(col), and for row > 1, A(row,col) = A005187(A(row-1,col)).

Original entry on oeis.org

2, 5, 3, 6, 8, 4, 9, 10, 15, 7, 12, 16, 18, 26, 11, 13, 22, 31, 34, 49, 19, 14, 23, 41, 57, 66, 95, 35, 17, 25, 42, 79, 110, 130, 184, 67, 20, 32, 47, 81, 153, 215, 258, 364, 131, 21, 38, 63, 89, 159, 302, 424, 514, 723, 259, 24, 39, 73, 120, 174, 312, 599, 844, 1026, 1440, 515, 27, 46, 74, 143, 236, 343, 620, 1192, 1683, 2050, 2876, 1027
Offset: 2

Views

Author

Antti Karttunen, Apr 14 2015

Keywords

Comments

The array is read by antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
This is transpose of array A256995.
If we assume that a(1) = 1 (but which is not explicitly included here because outside of the array proper), then A256998 gives the inverse permutation.

Examples

			The top left corner of the array:
    2,    5,    6,    9,   12,   13,   14,   17,   20,   21,    24,    27
    3,    8,   10,   16,   22,   23,   25,   32,   38,   39,    46,    50
    4,   15,   18,   31,   41,   42,   47,   63,   73,   74,    88,    97
    7,   26,   34,   57,   79,   81,   89,  120,  143,  145,   173,   191
   11,   49,   66,  110,  153,  159,  174,  236,  281,  287,   341,   375
   19,   95,  130,  215,  302,  312,  343,  467,  558,  568,   677,   743
   35,  184,  258,  424,  599,  620,  680,  928, 1111, 1132,  1349,  1479
   67,  364,  514,  844, 1192, 1235, 1356, 1852, 2216, 2259,  2693,  2951
  131,  723, 1026, 1683, 2380, 2464, 2707, 3697, 4428, 4512,  5381,  5895
  259, 1440, 2050, 3360, 4755, 4924, 5408, 7387, 8851, 9020, 10757, 11783
  ...
		

Crossrefs

Cf. A005187, A055938 (row 1), A256994 (column 1), A256989 (row index), A256990 (column index).
Inverse: A256998.
Transpose: A256995.
Cf. also A254107, A255557 (variants), A246278 (another thematically similar construction).

Programs

Formula

A(1,col) = A055938(col), and for row > 1, A(row,col) = A005187(A(row-1,col)).

A255559 One-based column index of n in array A255555.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 14 2015

Keywords

Comments

Equally: One-based row index of n in array A255557.

Crossrefs

Cf. also A255560 (corresponding row index).

Formula

a(1) = 1; for n > 1, if A213714(n) = 0 [i.e., if n is one of the terms of A055938], then a(n) = 1, otherwise 1 + a(A213714(n)-1).
In other words, a(1) = 1, and for n > 1, if n = A005187(k) for some k, then a(n) = 1 + a(k-1), otherwise it must be that n is in A055938, in which case a(n) = 1.
Other identities and observations. For all n >= 1:
a(n) <= A256478(n) <= A070939(n).
a(n) <= A256993(n) + 1.

A255555 Square array A(row,col) read by downwards antidiagonals: A(1,1) = 1, A(row,1) = A055938(row-1), and for col > 1, A(row,col) = A005187(1+A(row,col-1)).

Original entry on oeis.org

1, 3, 2, 7, 4, 5, 15, 8, 10, 6, 31, 16, 19, 11, 9, 63, 32, 38, 22, 18, 12, 127, 64, 74, 42, 35, 23, 13, 255, 128, 146, 82, 70, 46, 25, 14, 511, 256, 290, 162, 138, 89, 49, 26, 17, 1023, 512, 578, 322, 274, 176, 97, 50, 34, 20, 2047, 1024, 1154, 642, 546, 350, 193, 98, 67, 39, 21, 4095, 2048, 2306, 1282, 1090, 695, 385, 194, 134, 78, 41, 24
Offset: 1

Views

Author

Antti Karttunen, Apr 13 2015

Keywords

Comments

The array is read by antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
Provided that I understand Kimberling's terminology correctly, this array is the dispersion of sequence b(n) = A005187(n+1), for n>=1: A005187[2..] = [3, 4, 7, 8, 10, 11, ...]. The left column is the complement of that sequence, which is {1} followed by A055938. - Antti Karttunen, Apr 17 2015

Examples

			The top left corner of the array:
   1,  3,  7,  15,  31,  63,  127,  255,  511, 1023,  2047,  4095
   2,  4,  8,  16,  32,  64,  128,  256,  512, 1024,  2048,  4096
   5, 10, 19,  38,  74, 146,  290,  578, 1154, 2306,  4610,  9218
   6, 11, 22,  42,  82, 162,  322,  642, 1282, 2562,  5122, 10242
   9, 18, 35,  70, 138, 274,  546, 1090, 2178, 4354,  8706, 17410
  12, 23, 46,  89, 176, 350,  695, 1387, 2770, 5535, 11067, 22128
  13, 25, 49,  97, 193, 385,  769, 1537, 3073, 6145, 12289, 24577
  14, 26, 50,  98, 194, 386,  770, 1538, 3074, 6146, 12290, 24578
  17, 34, 67, 134, 266, 530, 1058, 2114, 4226, 8450, 16898, 33794
  20, 39, 78, 153, 304, 606, 1207, 2411, 4818, 9631, 19259, 38512
  ...
		

Crossrefs

Inverse permutation: A255556.
Transpose: A255557.
Row 1: A000225.
Cf. A255559 (column index), A255560 (row index).
Cf. also A254105, A256995 (variants), A233275-A233278.

Programs

Formula

A(1,1) = 1, A(row,1) = A055938(row-1), and for col > 1, A(row,col) = A005187(1+A(row,col-1)).

A255560 One-based row index of n in array A255555.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 14 2015

Keywords

Comments

Equally: One-based column index of n in array A255557.

Crossrefs

Cf. also A255559 (corresponding column index).

Formula

a(1) = 1; for n > 1, if A213714(n) = 0 [i.e., if n is one of the terms of A055938], then a(n) = 1+A234017(n), otherwise a(n) = a(A213714(n)-1).
In other words, a(1) = 1, and for n > 1, if n = A055938(k) for some k, then a(n) = k+1, otherwise it must be that n = A005187(h) for some h, in which case a(n) = a(h-1).
Showing 1-8 of 8 results.