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 12 results. Next

A256998 Inverse to A256997 considered as a permutation of natural numbers, with the assumed fixed term a(1) = 1.

Original entry on oeis.org

1, 2, 4, 7, 3, 5, 11, 6, 8, 9, 16, 12, 17, 23, 10, 13, 30, 14, 22, 38, 47, 18, 24, 57, 31, 15, 68, 80, 93, 107, 19, 39, 122, 20, 29, 138, 155, 48, 58, 173, 25, 32, 192, 212, 233, 69, 40, 255, 21, 81, 278, 302, 94, 108, 327, 123, 26, 353, 380, 408, 437, 467, 49, 139, 498, 27, 37, 530, 563, 156, 174, 597, 59, 70, 632, 668, 705, 193, 33, 743, 41
Offset: 1

Views

Author

Antti Karttunen, Apr 14 2015

Keywords

Crossrefs

Inverse: A256997.
Cf. also A256996, A255558.

Programs

  • Scheme
    (define (A256998 n) (if (= 1 n) n (let ((row (A256989 n)) (col (A256990 n))) (+ 1 (* (/ 1 2) (- (expt (+ row col) 2) row col col col -2))))))

Formula

a(1) = 1, and for n > 1: a(n) = (1/2) * ((c+r)^2 - r - 3*c + 4), where r = A256989(n), and c = A256990(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

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

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 6, 10, 8, 15, 9, 11, 19, 16, 31, 12, 18, 22, 38, 32, 63, 13, 23, 35, 42, 74, 64, 127, 14, 25, 46, 70, 82, 146, 128, 255, 17, 26, 49, 89, 138, 162, 290, 256, 511, 20, 34, 50, 97, 176, 274, 322, 578, 512, 1023, 21, 39, 67, 98, 193, 350, 546, 642, 1154, 1024, 2047, 24, 41, 78, 134, 194, 385, 695, 1090, 1282, 2306, 2048, 4095
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.
This is transpose of array A255555, see comments and links given there.

Examples

			The top left corner of the array:
     1,    2,    5,    6,    9,   12,   13,   14,   17,   20,    21,    24
     3,    4,   10,   11,   18,   23,   25,   26,   34,   39,    41,    47
     7,    8,   19,   22,   35,   46,   49,   50,   67,   78,    81,    94
    15,   16,   38,   42,   70,   89,   97,   98,  134,  153,   161,   184
    31,   32,   74,   82,  138,  176,  193,  194,  266,  304,   321,   365
    63,   64,  146,  162,  274,  350,  385,  386,  530,  606,   641,   726
   127,  128,  290,  322,  546,  695,  769,  770, 1058, 1207,  1281,  1447
   255,  256,  578,  642, 1090, 1387, 1537, 1538, 2114, 2411,  2561,  2891
   511,  512, 1154, 1282, 2178, 2770, 3073, 3074, 4226, 4818,  5121,  5778
  1023, 1024, 2306, 2562, 4354, 5535, 6145, 6146, 8450, 9631, 10241, 11551
  ...
		

Crossrefs

Inverse permutation: A255558.
Transpose: A255555.
Column 1: A000225.
Cf. A255559 (row index), A255560 (column index).
Cf. also A254107, A256997 (variants).

Programs

Formula

A(row,col): A(1,1) = 1, and for the rest of topmost row: A(1,col) = A055938(col-1), and for any row > 1: A(row,col) = A005187(1+A(row-1,col)).

A256989 One-based column index of n in array A256995.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 14 2015

Keywords

Comments

Also one-based row index for array A256997.
a(1) = 0 by convention, as 1 is outside of the actual arrays A256995 & A256997.

Crossrefs

Cf. A256990 (corresponding row index), A255559.

Formula

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

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

Original entry on oeis.org

2, 3, 5, 4, 8, 6, 7, 15, 10, 9, 11, 26, 18, 16, 12, 19, 49, 34, 31, 22, 13, 35, 95, 66, 57, 41, 23, 14, 67, 184, 130, 110, 79, 42, 25, 17, 131, 364, 258, 215, 153, 81, 47, 32, 20, 259, 723, 514, 424, 302, 159, 89, 63, 38, 21, 515, 1440, 1026, 844, 599, 312, 174, 120, 73, 39, 24, 1027, 2876, 2050, 1683, 1192, 620, 343, 236, 143, 74, 46, 27
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 A256997.
If we assume that a(1) = 1 (but which is not explicitly included here because outside of the array proper), then A256996 gives the inverse permutation.

Examples

			The top left corner of the array:
   2,  3,  4,   7,  11,  19,   35,   67,  131,  259,   515,  1027
   5,  8, 15,  26,  49,  95,  184,  364,  723, 1440,  2876,  5745
   6, 10, 18,  34,  66, 130,  258,  514, 1026, 2050,  4098,  8194
   9, 16, 31,  57, 110, 215,  424,  844, 1683, 3360,  6716, 13425
  12, 22, 41,  79, 153, 302,  599, 1192, 2380, 4755,  9504, 19004
  13, 23, 42,  81, 159, 312,  620, 1235, 2464, 4924,  9841, 19675
  14, 25, 47,  89, 174, 343,  680, 1356, 2707, 5408, 10812, 21617
  17, 32, 63, 120, 236, 467,  928, 1852, 3697, 7387, 14765, 29521
  20, 38, 73, 143, 281, 558, 1111, 2216, 4428, 8851, 17696, 35388
  21, 39, 74, 145, 287, 568, 1132, 2259, 4512, 9020, 18033, 36059
  ...
		

Crossrefs

Inverse permutation: A256996.
Transpose: A256997.
Cf. A005187, A055938 (column 1), A256994 (row 1), A256989 (column index), A256990 (row index).
Cf. also A254105, A255555 (variants), A114537, A246279 (other thematically similar constructions).

Programs

Formula

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

A256990 One-based row index of n in array A256995.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 14 2015

Keywords

Comments

Also one-based column index for array A256997.
a(1) = 0 by convention, as 1 is outside of the actual arrays A256995 & A256997.

Crossrefs

Cf. A256989 (corresponding column index), A255560.

Formula

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

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 03 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.
Column n gives the trajectory of iterates of A011371, when starting from A055938(n), thus stepping through successive parent-nodes when starting from the n-th leaf of binary beanstalk, until finally reaching the fixed point 0, which is the root of the whole binary tree.
The hanging tails of columns (upward from the first encountered zero) converge towards A179016.

Examples

			The top left corner of the array:
2, 5, 6, 9, 12, 13, 14, 17, 20, 21, 24, 27, 28, 29, 30, 33, 36, 37, 40, 43
1, 3, 4, 7, 10, 10, 11, 15, 18, 18, 22, 23, 25, 25, 26, 31, 34, 34, 38, 39
0, 1, 3, 4,  8,  8,  8, 11, 16, 16, 19, 19, 22, 22, 23, 26, 32, 32, 35, 35
0, 0, 1, 3,  7,  7,  7,  8, 15, 15, 16, 16, 19, 19, 19, 23, 31, 31, 32, 32
0, 0, 0, 1,  4,  4,  4,  7, 11, 11, 15, 15, 16, 16, 16, 19, 26, 26, 31, 31
0, 0, 0, 0,  3,  3,  3,  4,  8,  8, 11, 11, 15, 15, 15, 16, 23, 23, 26, 26
0, 0, 0, 0,  1,  1,  1,  3,  7,  7,  8,  8, 11, 11, 11, 15, 19, 19, 23, 23
0, 0, 0, 0,  0,  0,  0,  1,  4,  4,  7,  7,  8,  8,  8, 11, 16, 16, 19, 19
0, 0, 0, 0,  0,  0,  0,  0,  3,  3,  4,  4,  7,  7,  7,  8, 15, 15, 16, 16
0, 0, 0, 0,  0,  0,  0,  0,  1,  1,  3,  3,  4,  4,  4,  7, 11, 11, 15, 15
0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  1,  1,  3,  3,  3,  4,  8,  8, 11, 11
0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  3,  7,  7,  8,  8
0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  4,  4,  7,  7
0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  3,  4,  4
0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  3,  3
0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1
...
		

Crossrefs

Programs

A279342 a(0) = 1, a(1) = 2, a(2n) = A055938(a(n)), a(2n+1) = A005187(a(n)).

Original entry on oeis.org

1, 2, 5, 3, 12, 8, 6, 4, 27, 22, 17, 15, 13, 10, 9, 7, 58, 50, 45, 41, 36, 32, 30, 26, 28, 23, 21, 18, 20, 16, 14, 11, 121, 112, 103, 97, 92, 86, 84, 79, 75, 70, 65, 63, 61, 56, 55, 49, 59, 53, 48, 42, 44, 39, 37, 34, 43, 38, 33, 31, 29, 25, 24, 19, 248, 237, 227, 221, 210, 201, 196, 191, 187, 180, 175, 168, 171, 165, 160, 153, 154, 146, 141
Offset: 0

Views

Author

Antti Karttunen, Dec 10 2016

Keywords

Comments

Note the indexing: the domain starts from 0, while the range excludes zero.
This sequence can be represented as a binary tree. Each left hand child is produced as A055938(n), and each right hand child as A005187(n), when the parent node contains n:
1
|
...................2...................
5 3
12......../ \........8 6......../ \........4
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
27 22 17 15 13 10 9 7
58 50 45 41 36 32 30 26 28 23 21 18 20 16 14 11
etc.

Crossrefs

Inverse: A279341.
Right edge: A256994.
Related or similar permutations: A054429, A163511, A233278, A256997, A279339, A279344, A279347.

Programs

Formula

a(0) = 1, a(1) = 2, and then after, a(2n) = A055938(a(n)), a(2n+1) = A005187(a(n)).
As a composition of other permutations:
a(n) = A279344(A054429(n)).
a(n) = A279347(A279344(n)).
a(n) = A279339(A163511(n)).

A279344 a(0) = 1, a(2n) = A005187(a(n)), a(2n+1) = A055938(a(n)).

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 8, 12, 7, 9, 10, 13, 15, 17, 22, 27, 11, 14, 16, 20, 18, 21, 23, 28, 26, 30, 32, 36, 41, 45, 50, 58, 19, 24, 25, 29, 31, 33, 38, 43, 34, 37, 39, 44, 42, 48, 53, 59, 49, 55, 56, 61, 63, 65, 70, 75, 79, 84, 86, 92, 97, 103, 112, 121, 35, 40, 46, 51, 47, 52, 54, 60, 57, 62, 64, 68, 73, 77, 82, 90, 66, 69, 71, 76, 74, 80
Offset: 0

Views

Author

Antti Karttunen, Dec 10 2016

Keywords

Comments

Note the indexing: the domain starts from 0, while the range excludes zero.
This sequence can be represented as a binary tree. Each left hand child is produced as A005187(n), and each right hand child as A055938(n), when the parent node contains n:
1
|
...................2...................
3 5
4......../ \........6 8......../ \........12
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 9 10 13 15 17 22 27
11 14 16 20 18 21 23 28 26 30 32 36 41 45 50 58
etc.

Crossrefs

Inverse: A279343.
Left edge: A256994.
Related or similar permutations: A005940, A054429, A233276, A256997, A279339, A279342, A279347.

Programs

Formula

a(0) = 1, after which, a(2n) = A005187(a(n)), a(2n+1) = A055938(a(n)).
As a composition of other permutations:
a(n) = A279342(A054429(n)).
a(n) = A279347(A279342(n)).
a(n) = A279339(A005940(1+n)).

A256994 a(n) = n + 1 when n <= 3, otherwise a(n) = 2^(n-2) + 3; also iterates of A005187 starting from a(1) = 2.

Original entry on oeis.org

2, 3, 4, 7, 11, 19, 35, 67, 131, 259, 515, 1027, 2051, 4099, 8195, 16387, 32771, 65539, 131075, 262147, 524291, 1048579, 2097155, 4194307, 8388611, 16777219, 33554435, 67108867, 134217731, 268435459, 536870915, 1073741827, 2147483651, 4294967299, 8589934595, 17179869187, 34359738371, 68719476739, 137438953475, 274877906947
Offset: 1

Views

Author

Antti Karttunen, Apr 15 2015

Keywords

Comments

Note that if we instead iterated function b(n) = 1+A005187(n), from b(1) onward, we would get the powers of two, A000079.

Crossrefs

Topmost row of A256995, leftmost column of A256997.

Programs

  • Mathematica
    Table[If[n<4,n+1,2^(n-2)+3],{n,40}] (* Harvey P. Dale, May 14 2019 *)
  • PARI
    A256994(n) = if(n < 4, n+1, 2^(n-2) + 3);
    
  • PARI
    \\ By iterating A005187:
    A005187(n) = { my(s=n); while(n>>=1, s+=n); s; };
    i=1; k=2; print1(k); while(i <= 40, k = A005187(k); print1(", ", k); i++);
    
  • Scheme
    (define (A256994 n) (if (< n 4) (+ n 1) (+ (A000079 (- n 2)) 3)))
    
  • Scheme
    ;; The following uses memoization-macro definec:
    (definec (A256994 n) (if (= 1 n) 2 (A005187 (A256994 (- n 1)))))

Formula

If n < 4, a(n) = n + 1, otherwise a(n) = 2^(n-2) + 3 = A062709(n-2).
a(1) = 2; for n > 1, a(n) = A005187(a(n-1)).
Showing 1-10 of 12 results. Next