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

A257508 Next-to-leaf vertices in binary beanstalk; Numbers n for which A257265(n) = 1.

Original entry on oeis.org

1, 3, 4, 7, 10, 11, 15, 18, 22, 23, 25, 26, 31, 34, 38, 39, 41, 46, 47, 49, 50, 54, 56, 57, 63, 66, 70, 71, 73, 78, 79, 81, 82, 86, 88, 94, 95, 97, 98, 102, 104, 105, 110, 113, 116, 117, 119, 120, 127, 130, 134, 135, 137, 142, 143, 145, 146, 150, 152, 158, 159, 161, 162, 166, 168, 169, 174, 177, 180, 181
Offset: 1

Views

Author

Antti Karttunen, May 03 2015

Keywords

Comments

Numbers n for which A257265(n) = 1, in other words, numbers n for which a descendant leaf nearest to n in binary beanstalk is one edge away.
Numbers n such that either A079559(A213723(n)) or A079559(A213724(n)) (or both) are zero.
Equal to A257507 with duplicate terms removed.

Examples

			3 is present because it has an immediate leaf-child 5, as A011371(5) = 3.
4 is present because it has an immediate leaf-child 6, as A011371(6) = 4.
10 is present because it has two immediate leaf-children, 12 and 13, as A011371(12) = A011371(13) = 10.
See also Paul Tek's illustration.
		

Crossrefs

Positions of 1's in A257265.
Subsequence of A005187.
Cf. A011371, A079559, A213723, A213724, A257507, A257509, A257512 (a subsequence).

Programs

  • Haskell
    a257508 n = a257508_list !! (n-1)
    a257508_list = filter ((== 1) . a257265) [0..]
    -- Reinhard Zumkeller, May 06 2015

A257509 Numbers n for which A257265(n) = 2; numbers for which the nearest descendant leaf in the binary beanstalk is two edges away.

Original entry on oeis.org

0, 8, 16, 19, 32, 35, 42, 53, 64, 67, 74, 85, 89, 101, 109, 112, 128, 131, 138, 149, 153, 165, 173, 176, 184, 197, 205, 208, 221, 224, 231, 240, 256, 259, 266, 277, 281, 293, 301, 304, 312, 325, 333, 336, 349, 352, 359, 368, 375, 389, 397, 400, 413, 416, 423, 432, 445, 448, 455, 464, 470, 480, 487, 492, 512
Offset: 1

Views

Author

Antti Karttunen, May 03 2015

Keywords

Comments

Numbers n for which A257265(n) = 2.

Examples

			8 is present, because 12, 13 and 14 are the three leaves (terms of A055938) nearest to 8, and A011371(12) = A011371(13) = 10, A011371(14) = 11, A011371(10) = A011371(11) = 8 (thus it takes two iterations of A011371 to reach 8 from any of those three leaves). See also Paul Tek's illustration.
		

Crossrefs

First differences: A256489.
Positions of 2's in A257265.
Subsequence of A005187.

Programs

  • Haskell
    a257509 n = a257509_list !! (n-1)
    a257509_list = filter ((== 2) . a257265) [0..]
    -- Reinhard Zumkeller, May 06 2015

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

A127885 a(n) = minimal number of steps to get from n to 1, where a step is x -> 3x+1 if x is odd, or x -> either x/2 or 3x+1 if x is even; or -1 if 1 is never reached.

Original entry on oeis.org

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

Views

Author

David Applegate and N. J. A. Sloane, Feb 04 2007

Keywords

Comments

In contrast to the "3x+1" problem (see A006577), here you are free to choose either step if x is even.
See A125731 for the number of steps in the reverse direction, from 1 to n.

Examples

			Several early values use the path:
6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1.
The first path where choosing 3x+1 for even x helps is:
9 -> 28 -> 85 -> 256 -> 128 -> 64 -> 32 -> 16 -> 8 -> 4 -> 2 -> 1.
		

References

  • M. J. Halm, Sequences (Re)discovered, Mpossibilities 81 (Aug. 2002), p. 1.

Crossrefs

A127886 gives the difference between A006577 and this sequence.
Cf. A290100 (size of the final set when using Alekseyev's algorithm).
Cf. also A257265.

Programs

  • Maple
    # Code from David Applegate: Be careful - the function takes an iteration limit and returns the limit if it wasn't able to determine the answer (that is, if A127885(n,lim) == lim, all you know is that the value is >= lim). To use it, do manual iteration on the limit.
    A127885 := proc(n,lim) local d,d2; options remember;
    if (n = 1) then return 0; end if;
    if (lim <= 0) then return 0; end if;
    if (n > 2 ^ lim) then return lim; end if;
    if (n mod 2 = 0) then
    d := A127885(n/2,lim-1);
    d2 := A127885(3*n+1,d);
    if (d2 < d) then d := d2; end if;
    else
    d := A127885(3*n+1,lim-1);
    end if;
    return 1+d;
    end proc;
  • Mathematica
    Table[-1 + Length@ NestWhileList[Flatten[# /. {k_ /; OddQ@ k :> 3 k + 1, k_ /; EvenQ@ k :> {k/2, 3 k + 1}}] &, {n}, FreeQ[#, 1] &], {n, 126}] (* Michael De Vlieger, Aug 20 2017 *)
  • PARI
    { A127885(n) = my(S,k); S=[n]; k=0; while( S[1]!=1, k++; S=vecsort( concat(apply(x->3*x+1,S), apply(x->x\2, select(x->x%2==0,S) )),,8);  ); k } /* Max Alekseyev, Sep 03 2015 */

Formula

a(1) = 0; and for n > 1, if n is odd, a(n) = 1 + a(3n+1), and if n is even, a(n) = 1 + min(a(3n+1),a(n/2)). [But with a similar caveat as in A257265] - Antti Karttunen, Aug 20 2017

Extensions

Escape clause added to definition by N. J. A. Sloane, Aug 20 2017

A256993 a(1) = 0; for n > 1, a(n) = 1 + a(A256992(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 15 2015

Keywords

Comments

Number of iterations of A256992 needed to reach one when starting from n.

Crossrefs

Formula

a(1) = 0; for n > 1, a(n) = 1 + a(A256992(n)).
Other observations. For all n >= 1 it holds that:
a(n) >= A254110(n).
a(n) >= A256989(n).
a(n) >= A255559(n)-1.
Also it seems that a(n) - A070939(n) = -1, 0 or +1 for all n >= 1. [Compare A256991 and A256992 to see the connection.]
It is also very likely that a(n) <= A071542(n) for all n.
From Antti Karttunen, Dec 10 2016: (Start)
For all n >= 2, a(n) = A070939(A279341(n)) = A070939(A279343(n)).
For all n >= 2, a(n) = A279345(n) + A279346(n) - 1.
(End)

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

A257512 Those vertices of the binary beanstalk whose children are both leaves.

Original entry on oeis.org

10, 18, 25, 34, 41, 54, 56, 66, 73, 86, 88, 102, 110, 117, 119, 130, 137, 150, 152, 166, 174, 181, 183, 198, 206, 213, 222, 229, 243, 244, 246, 258, 265, 278, 280, 294, 302, 309, 311, 326, 334, 341, 350, 357, 371, 372, 374, 390, 398, 405, 414, 421, 435, 436, 446, 453, 467, 468, 483, 491, 498, 499, 501, 514
Offset: 1

Views

Author

Antti Karttunen, May 03 2015

Keywords

Comments

Numbers n for which both A079559(A213723(n)) and A079559(A213724(n)) are zero.
Numbers which occur twice in A257507.

Examples

			10 is present, because A011371(12) = A011371(13) = 10, and both 12 and 13 are terms of A055938. See also Paul Tek's illustration.
		

Crossrefs

First differences: A256490.
Subsequence of A005187, A213717 and A257508.
Showing 1-7 of 7 results.