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

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.

A213725 a(n)=0 if n is in the infinite trunk of Carl White's beanstalk (i.e., in A179016), otherwise 1 + number of steps to reach the farthest leaf 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
Offset: 0

Views

Author

Antti Karttunen, Nov 01 2012

Keywords

Crossrefs

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

Formula

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

A255327 a(n) = 0 if n is in the infinite trunk of "number-of-runs beanstalk" (one of the terms of A255056), otherwise number of nodes (including leaves and the node n itself) in that finite subtree of the beanstalk.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1, 5, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 3, 1, 0, 1, 2, 1, 4, 1, 0, 1, 2, 1, 0, 1, 5, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 3, 1, 0, 1, 2, 1, 10, 1, 0, 1, 8, 1, 0, 1, 3, 1, 2, 1, 0, 1, 2, 1, 4, 1, 0, 1, 2, 1, 0, 1, 0, 1, 3, 1, 0, 1, 2, 1, 4, 1, 0, 1, 2, 1, 0, 1, 5, 1, 0, 1, 2, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 21 2015

Keywords

Comments

The edge-relation between nodes is given by A236840(child) = parent. a(n) = 1 + the size of transitive closure of all children emanating from the parent at n. For any n in A255056 this would be infinite, thus such n are marked with zeros.
Odd numbers are leaves, as there are no such k that A236840(k) were odd, thus a(2n+1) = 1.

Crossrefs

Formula

a(2n+1) = 1, and for even numbers 2n, if A255339(n) = 1, then a(2n) = 0, otherwise, a(2n) = 1 + sum_{k = A091067(n) .. A255068(n)} a(k).

A262697 a(n)=0 if n is in A259934, otherwise number of nodes (including leaves and the node n itself) in that finite subtree whose root is n and edge-relation is defined by A049820(child) = parent.

Original entry on oeis.org

0, 6, 0, 3, 2, 2, 0, 1, 1, 38, 3, 37, 0, 1, 2, 33, 2, 32, 0, 1, 1, 30, 0, 29, 1, 1, 3, 28, 1, 26, 0, 24, 2, 1, 0, 23, 1, 1, 16, 21, 1, 2, 0, 1, 2, 18, 0, 17, 13, 1, 1, 16, 1, 14, 0, 1, 1, 13, 0, 10, 11, 9, 0, 1, 1, 8, 1, 1, 1, 6, 0, 4, 10, 3, 1, 1, 23, 2, 0, 1, 2, 22, 4, 20, 9, 1, 3, 19, 1, 5, 0, 13, 2, 4, 0, 11, 8, 10, 1, 3, 1, 2, 0, 1, 6, 9, 0, 8, 1, 1, 2, 6, 1, 1, 0, 3, 1, 1, 0, 2, 5, 0, 12, 1
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, together {1, 3, 4, 5, 7, 8}. We see that there are no other nodes in a 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 both 7 and 8 are terms of A045765. Thus a(1) = 6.
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}, containing 38 terms, thus a(9) = 38.
		

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 + Sum_{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).

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)).

A227643 a(0)=1; for n > 0, a(n) = 1 + Sum_{i=A228086(n)..A228087(n)} [A092391(i) = n]*a(i), where [] is the Iverson bracket, resulting in 1 when i + A000120(i) = n and 0 otherwise.

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 1, 6, 2, 3, 7, 4, 8, 1, 13, 1, 2, 16, 1, 18, 2, 1, 21, 1, 2, 22, 3, 2, 23, 4, 1, 26, 1, 6, 2, 7, 29, 1, 37, 1, 2, 38, 3, 2, 39, 4, 1, 42, 1, 5, 3, 1, 48, 4, 1, 50, 1, 5, 2, 2, 51, 6, 3, 1, 54, 55, 7, 59, 8, 2, 68, 1, 3, 69, 4, 2, 70, 5, 1, 73, 1
Offset: 0

Views

Author

Andres M. Torres, Jul 18 2013

Keywords

Comments

Each a(n) = 1 + the count of nodes in the finite subtree defined by the edge relation parent = child + A000120(child). In other words, one more than the count of n's descendants, by which we mean the whole transitive closure of all children emanating from the parent at n. The subtree is finite because successive descendant values get smaller and approach zero.

Examples

			0 has no children distinct from itself (we only have A092391(0)=0), so we define a(0) = (0+1) = 1,
1 has no children (it is one of the terms of A010061), so a(1) = (0+1) = 1,
4 and 6 are also members of A010061, so both a(4) and a(6) = (0+1) = 1,
7 has 1,2,3,4 and 5 among its descendants (as A092391(5)=7, A092391(3)=A092391(4)=5, A092391(2)=3, A092391(1)=2), so a(7) = (5+1) = 6,
8 has 6 as a child value,        so a(8) = (1+1) = 2,
9 has 6 and 8 as descendants,    so a(9) = (2+1) = 3,
10 has {1,2,3,4,5,7}             so a(10) = (6+1) = 7.
		

Crossrefs

Cf. A010061 (gives the positions of ones), A000120, A092391, A228082, A228083, A228085, A227359, A227361, A227408.
Cf. also A213727 for a descendant counts for a similar tree defined by the edge relation parent = child - A000120(child).

Programs

  • Scheme
    ;; A deficient definition which works only up to n=128:
    (definec (A227643deficient n) (cond ((zero? n) 1) ((zero? (A228085 n)) 1) ((= 1 (A228085 n)) (+ 1 (A227643deficient (A228086 n)))) ((= 2 (A228085 n)) (+ 1 (A227643deficient (A228086 n)) (A227643deficient (A228087 n)))) (else (error "Not yet implemented for cases where n has more than two immediate children!"))))
    ;; Another definition that works for all n, but is somewhat slower:
    (definec (A227643full n) (cond ((zero? n) 1) (else (+ 1 (add (lambda (i) (if (= (A092391 i) n) (A227643full i) 0)) (A228086 n) (A228087 n))))))
    ;; Auxiliary function add implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    ;; by Antti Karttunen, Aug 16 2013, macro definec can be found in his IntSeq-library.

Formula

From Antti Karttunen, Aug 16 2013: (Start)
a(0)=1; and for n > 0, if A228085(n)=0 then a(n)=1; if A228085(n)=1 then a(n)=1+a(A228086(n)); if A228085(n)=2 then a(n)=1+a(A228086(n))+a(A228087(n)); otherwise (when A228085(n)>2) cannot be computed with this formula, which works only up to n=128.
a(0)=1; and for n > 0, a(n) = 1+Sum_{i=A228086(n)..A228087(n)} [A092391(i) = n]*a(i). (Here [...] denotes the Iverson bracket, resulting in 1 when i+A000120(i) = n and 0 otherwise. This formula works with all n.) (End)

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

This sequence relates to the factorial base representation (A007623) in the same way as A213727 relates to the binary system.

Examples

			From 11 sprouts the following finite side-tree of "factorial beanstalk":
    18  19
     \  /
  14  15
   \  /
    11
Its leaves are the numbers 14, 18 and 19 (which all occur in A219658), whose factorial base representations (see A007623) are '210', '300' and '301' respectively. The corresponding parent nodes are obtained by subtracting the sum of factorial base digits, thus we get 18-3 = 15 and also 19-4 = 15, thus 15 ('211' in factorial base) is the parent of 18 and 19. For 14 and 15 we get 14-3 = 15-4 = 11, thus 11 is the parent of both 14 and 15, and the common ancestor of all numbers 11, 14, 15, 18 and 19.
For numbers not occurring in A219666 this sequence gives 1 + the number of all descendant nodes in such subtrees. Thus a(11)=5, a(14)=1 (counting just the leaf 14 itself), a(15)=3 and a(18) = a(19) = 1.
		

Crossrefs

A219658 gives the position of ones (leaves). Cf. also A230407, A230423-A230424, A230425-A230426, A230430.

Formula

If A230412(n)=0, a(n)=1; otherwise, if n is in A219666, a(n)=0; otherwise a(n) = 1 + a(A230423(n)) + a(A230424(n)).
Alternatively, if A230426(n)=0, a(n)=0; otherwise (2*A230426(n))-1.

A218618 Absolute value of a(n) tells the size of the n-th side-tree ("tendril", A213730(n)) in the binary beanstalk; the sign tells on which side of the infinite trunk (A179016) it is.

Original entry on oeis.org

0, 1, -1, 1, -1, 3, 1, -1, 3, 5, -1, 1, -1, 3, 5, -1, -7, 1, 1, 3, 1, -1, 3, 5, -1, -7, 1, 1, 3, -7, 1, 1, -5, 1, -5, -3, -1, 1, -1, 3, 5, -1, -7, 1, 1, 3, -7, 1, 1, -5, 1, -5, -3, -1, -7, 1, 1, -5, 1, 11, 1, 1, 13, 1, -5, -1, 3, 1, -1, 3, 5, -1, -7, 1, 1, 3
Offset: 0

Views

Author

Antti Karttunen, Dec 03 2012

Keywords

Comments

Positive and negative terms correspond to the tendrils that sprout respectively at the left and right sides of the infinite trunk, when the beanstalk is drawn with the lesser numbers branching to the left. The absolute values give the sizes of those tendrils, with all nodes included: The leaves, the internal vertices as well as the root itself: A213730(n).

Crossrefs

Partial sums: A218785, A218789. Cf. also A218786, A218613.

Programs

Formula

a(n) = -1^A213730(n) * A213727(A213730(n)).
Showing 1-10 of 11 results. Next