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

A218550 a(n) = A213725(A218548(n)).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 19, 15, 16, 27, 39, 51, 67
Offset: 1

Views

Author

Antti Karttunen, Nov 04 2012

Keywords

Comments

a(n) tells the maximum depth + 1 of the n-th record size finite side-tree in the infinite beanstalk.

Examples

			a(7)=6 as the finite tree of 7 leaves (233, 234, 235, 238, 245, 250 and 251) and 6 internal vertices (244, 239, 232, 229, 228 and 224) rooted at 224 has the maximum depth of 5 (the path 224 -> 228 -> 232 -> 239 -> 244 -> 250/251).
		

Crossrefs

Cf. A218549.

Programs

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

A213723 a(n) = smallest natural number x such that x=n+A000120(x), otherwise zero.

Original entry on oeis.org

0, 2, 0, 4, 6, 0, 0, 8, 10, 0, 12, 14, 0, 0, 0, 16, 18, 0, 20, 22, 0, 0, 24, 26, 0, 28, 30, 0, 0, 0, 0, 32, 34, 0, 36, 38, 0, 0, 40, 42, 0, 44, 46, 0, 0, 0, 48, 50, 0, 52, 54, 0, 0, 56, 58, 0, 60, 62, 0, 0, 0, 0, 0, 64, 66, 0, 68, 70, 0, 0, 72, 74, 0, 76, 78
Offset: 0

Views

Author

Antti Karttunen, Nov 01 2012

Keywords

Examples

			a(1) = 2, as 2 is the smallest natural number such that x such that x=1+A000120(x) (as 2=1+A000120(2)=1+1).
a(2) = 0, as there are no solutions for 2, because it belongs to A055938.
a(11) = 14, as 14 is the smallest natural number x such that x=11+A000120(x) (as 14=11+A000120(14)=11+3).
		

Crossrefs

a(A055938(n)) = 0. a(A005187(n)) = A005843(n) = 2n.
Cf. A213724. Used for computing A213725-A213727. Cf. A179016.

Programs

Formula

a(n) = 2*A213714(n).
Also, by partitioning into sums of distinct nonzero terms of A000225: if n can be formed as a sum of (2^a)-1 + (2^b)-1 + (2^c)-1, etc. where the exponents a, b, c are distinct and all > 0, then a(n) = 2^a + 2^b + 2^c, etc. If this is not possible, then n is one of the terms of A055938, and a(n)=0.

A213724 Largest natural number x such that x = n + A000120(x), or zero if no such number exists.

Original entry on oeis.org

1, 3, 0, 5, 7, 0, 0, 9, 11, 0, 13, 15, 0, 0, 0, 17, 19, 0, 21, 23, 0, 0, 25, 27, 0, 29, 31, 0, 0, 0, 0, 33, 35, 0, 37, 39, 0, 0, 41, 43, 0, 45, 47, 0, 0, 0, 49, 51, 0, 53, 55, 0, 0, 57, 59, 0, 61, 63, 0, 0, 0, 0, 0, 65, 67, 0, 69, 71, 0, 0, 73, 75, 0, 77, 79, 0, 0, 0, 81, 83, 0, 85, 87, 0, 0, 89, 91
Offset: 0

Views

Author

Antti Karttunen, Nov 01 2012

Keywords

Crossrefs

One more than A213723 at its nonzero points. a(A005187(n)) = A005408(n). Used for computing A213725-A213727.
Cf. A179016. - M. F. Hasler, Nov 01 2012

Programs

  • Haskell
    a213724 0 = 1
    a213724 n = a213723 n + signum (a213723 n)
    -- Reinhard Zumkeller, May 01 2015
  • Scheme
    (define (A213724 n) (if (zero? n) 1 (let ((v (A213723 n))) (if (zero? v) v (+ 1 v)))))
    

Formula

a(0)=1; and for n>=1, a(n)=0 if A079559(n)=0 (i.e., if A213723(n)=0); otherwise A213723(n)+1.

A213710 Number of steps to reach 0 when starting from 2^n and iterating the map x -> x - (number of 1's in binary representation of x): a(n) = A071542(2^n) = A218600(n)+1.

Original entry on oeis.org

1, 2, 3, 5, 8, 13, 22, 39, 69, 123, 221, 400, 730, 1344, 2494, 4656, 8728, 16406, 30902, 58320, 110299, 209099, 397408, 757297, 1446946, 2771952, 5323983, 10250572, 19780123, 38243221, 74058514, 143592685, 278661809, 541110612, 1051158028, 2042539461, 3969857206
Offset: 0

Views

Author

Antti Karttunen, Oct 26 2012

Keywords

Comments

Conjecture: A179016(a(n))= 2^n for all n apart from n=2. This is true if all powers of 2 except 2 itself occur in A179016 as in that case they must occur at positions given by this sequence.
This is easy to prove: It suffices to note that after 3 no integer of form (2^k)+1 can occur in A005187, thus for all k >= 2, A213725((2^k)+1) = 1 or equally: A213714((2^k)+1) = 0. - Antti Karttunen, Jun 12 2013

Crossrefs

One more than A218600, which is the partial sums of A213709, thus the latter also gives the first differences of this sequence.
Analogous sequences: A219665, A255062.

Formula

a(n) = A071542(A000079(n)) = A071542(2^n).
a(n) = 1 + A218600(n).

Extensions

a(29)-a(36) from Alois P. Heinz, Jul 03 2022

A213727 a(n) = 0 if n is in the infinite trunk of the "binary beanstalk", otherwise number of nodes (including leaves and the node n itself) in that finite branch of the beanstalk.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 3, 0, 1, 1, 1, 0, 0, 1, 3, 0, 1, 1, 5, 0, 1, 3, 0, 1, 1, 1, 1, 0, 0, 1, 3, 0, 1, 1, 5, 0, 1, 3, 0, 1, 1, 1, 0, 7, 1, 0, 5, 1, 1, 0, 3, 1, 3, 0, 1, 1, 1, 1, 1, 0, 0, 1, 3, 0, 1, 1, 5, 0, 1, 3, 0, 1, 1, 1, 0, 7, 1, 0, 5, 1, 1, 0, 3
Offset: 0

Views

Author

Antti Karttunen, Nov 01 2012

Keywords

Comments

a(n) tells, for each natural number n, whether it belongs to the infinite trunk of the binary beanstalk (in A179016, when a(n)=0), or if it is one of the terminal nodes (i.e., leaves, A055938, when a(n)=1), or otherwise, when a(n) > 1, tells from how many different numbers one can arrive at this n by repeatedly subtracting their bit-count (A000120) from them (as explained in A071542), and including also n itself as one of the cases.
a(n) is always odd unless it is zero. In particular, each a(A213717(n)) is an odd number greater than one.

Examples

			a(10) = 3 because we include 10 itself ("1010" in binary) and the two numbers n for which it is true that n - A000120(n) = 10, i.e., 12 and 13 ("1100" and "1101" in binary). Furthermore, there do not exist any such numbers for 12 or 13, as both are members of A055938 (see also the comment at A213717).
Similarly, a(22) = 5 as there are the following five cases: 22 itself, 24 as 24-A000120(24) = 24-2 = 22 (note that 24 is in A055938), 25 as 25-A000120(25) = 25-3 = 22, and the two terminal nodes (leaves) branching from 25, that is, 28 & 29 (as 28-A000120(28) = 28-3 = 25, and 29-A000120(29) = 29-4=25).
		

Crossrefs

Cf. A179016.
Analogous sequences computed for other "beanstalk" or similar tree systems: A227643, A230427, A255327.

Formula

If A079559(n)=0, a(n)=1; otherwise, if A213719(n)=1, a(n)=0; otherwise a(n) = 1+a(A213723(n))+a(A213724(n)).
Other identities. For all n:
a(A179016(n)) = 0, a(A055938(n)) = 1, and a(A213717(n)) >= 3.
a(A213717(n)) = (2*A213726(A213717(n)))-1.

A213726 a(n)=0 if n is in the infinite trunk of the "beanstalk" (i.e., in A179016), otherwise number of terminal nodes (leaves) in that finite branch of the beanstalk.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 01 2012

Keywords

Comments

a(n) tells for each natural number n, whether it belongs to the infinite trunk of beanstalk (when a(n)=0), or if it is one of the terminal nodes (i.e., leaves, A055938) (when a(n)=1), or otherwise, when a(n)>1, tells from how many terminal nodes one can end to this n, by repeatedly subtracting their bit count (A000120) from them (as explained in A071542).

Examples

			a(10)=2 because the only numbers in A055938 from which one can end to 10 by the process described in A071542/A179016 are 12 and 13 (see comment at A213717). Similarly, a(22)=3 as there are following three cases: 24 as 24-A000120(24) = 24-2 = 22, and also 28 & 29 as 28-A000120(28) = 28-3 = 25, and 29-A000120(29) = 29-4 = 25, and then 25-A000120(25) = 25-3 = 22.
		

Crossrefs

Differs from A213725 for the first time at n=208, where a(n)=6, while A213725(208)=5.
For all n, a(A179016(n)) = 0, a(A055938(n)) = 1, and a(A213717(n)) >= 2. For all n, A213727(A213717(n)) = (2*a(A213717(n)))-1. Cf. A213725-A213731. Records: A218548, A218549.

Formula

If A079559(n)=0, a(n)=1; otherwise, if A213719(n)=1, a(n)=0; otherwise a(n) = a(A213723(n))+a(A213724(n)).

A262695 a(n)=0 if n is in A259934, otherwise 1 + number of steps to reach the farthest leaf in that finite branch of the tree defined by edge-relation A049820(child) = parent.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 04 2015

Keywords

Examples

			For n=1, its transitive closure (as defined by edge-relation A049820(child) = parent) is the union of {1} itself together with all its descendants: {1, 3, 4, 5, 7, 8}. We see that there are no other nodes in this subtree whose root is 1, because A049820(3) = 3 - d(3) = 1, A049820(4) = 1, A049820(5) = 3, A049820(7) = 5, A049820(8) = 4 and of these only 7 and 8 are terms of A045765 (leaves). Starting iterating from 7 with A049820, we get 7 -> 5, 5 -> 3, 3 -> 1, and starting from 8 we get 8 -> 4, 4 -> 1, of which the former path is longer (3 steps), thus a(1) = 3+1 = 4.
For n=9, its transitive closure is {9, 11, 13, 15, 16, 17, 19, 21, 23, 24, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79}. In this case the longest path is obtained by starting iterating from the largest of these: 79 -> 77 -> 73 -> 71 -> 69 -> 65 -> 61 -> 59 -> 57 -> 53 -> 51 -> 47 -> 45 -> 39 -> 35 -> 31 -> 29 -> 27 -> 23 -> 21 -> 17 -> 15 -> 11 -> 9, which is 23 steps long, thus a(9) = 23+1 = 24.
		

Crossrefs

Formula

If A262693(n) = 1 [when n is in A259934],
then a(n) = 0,
otherwise, if A060990(n) = 0 [when n is one of the leaves, A045765],
then a(n) = 1,
otherwise:
a(n) = 1 + Max_{k = A082284(n) .. A262686(n)} [A049820(k) = n] * a(k).
(In the last clause [ ] stands for Iverson bracket, giving as its result 1 only when A049820(k) = n, and 0 otherwise).

A257265 Distance to n from a leaf nearest to n in the binary beanstalk.

Original entry on oeis.org

2, 1, 0, 1, 1, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 1, 0, 1, 2, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 1, 0, 1, 2, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 1, 0, 0, 0, 2, 1, 0, 2, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2
Offset: 0

Views

Author

Antti Karttunen, Apr 29 2015

Keywords

Comments

If n is one of the terms of A055938 (that is, one of the leaves of the binary beanstalk), then a(n) is zero. Otherwise, a(n) is the least number of iterations of A011371 required to reach n, when we start from any term of A055938.
Compare to the definition of A213725, which gives 1 + distance to the farthest leaf in the binary beanstalk (giving 0 for the nodes which reside in A179016, the infinite stem of the beanstalk, as there the maximum distance would not have a finite value).
Note that although the recursive formula given here mirrors the one given at A213725, it cannot be implemented in a naive way, precisely because of that infinite stem, as it would lead to recursion without end. Instead, with ordinary eagerly evaluating programming languages we have to employ, for example, a breadth-first search, as in the given Scheme-program.
Question: Will there ever appear a term larger than 2? (Only terms 0 - 2 occur in range 0 .. 2097151).

Examples

			For 0, the nearest leaf is 2, as when we start from 2, and always subtract the binary weight, A000120, we have: 2 - A000120(2) = A011371(2) = 1, and A011371(1) = 0, thus it takes two steps to get to 0, and there are no other terms of A055938 from which it would take fewer steps), so a(0) = 2, and also a(1) = 1, because it's one step nearer to 2.
a(2) = 0, because 2 is one of the terms of A055938.
a(8) = 2, because 12, 13 and 14 are the three nearest leaves 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) and there are no leaves nearer.
Please see also Paul Tek's illustration.
		

Crossrefs

Cf. A055938 (positions of 0's), A257508 (of 1's), A257509 (of 2's).
Cf. also A179016, A213725, A257264.

Programs

  • Haskell
    a257265 = length . us where
       us n = if a079559 n == 0
                 then [] else () : zipWith (const $ const ())
                                   (us $ a213723 n) (us $ a213724 n)
    -- Reinhard Zumkeller, May 03 2015
  • Scheme
    ;; Do a breadth-first search over the descendants, which are at each step of iteration sorted by their distance from the starting node.
    (define (A257265 n) (let loop ((descendants (list (cons 0 n)))) (let ((dist (caar descendants)) (node (cdar descendants))) (cond ((zero? (A079559 node)) dist) (else (loop (sort (append (list (cons (+ 1 dist) (A213724 node)) (cons (+ 1 dist) (A213723 node))) (cdr descendants)) (lambda (a b) (< (car a) (car b))))))))))
    

Formula

If A079559(n) = 0, then a(n) = 0, otherwise a(n) = 1 + min(a(A213723(n)), a(A213724(n))). [But please see the comments above.]

A213731 a(n)=0 if n is in A055938, a(n)=1 if n is in A179016, otherwise (i.e., n is in A213717), a(n)=2.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 2, 1, 0, 2, 1, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 2, 1, 0, 2, 1, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 2, 1, 0, 2, 1, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2
Offset: 0

Views

Author

Antti Karttunen, Nov 01 2012

Keywords

Comments

Those natural numbers n for which a(n)=1 belong to the infinite trunk of "Carl White's beanstalk" (see A179016), while the numbers n for which a(n)=0, are the leaves (terminal, dead-end nodes) of the same beanstalk, while those n for which a(n)=2, are non-terminal nodes in its finite tendrils.

Crossrefs

Programs

Formula

a(n) = 2*A079559(n) - A213719(n).
Showing 1-10 of 12 results. Next