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

A218603 a(n) = A179016(n) - A213708(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 03 2012

Keywords

Comments

For all n, the following holds: A213708(n) <= A179016(n) <= A173601(n). This sequence gives the distance of the node n in the infinite trunk of beanstalk (A179016(n)) from the lesser edge of the A086876(n) wide window which it at that point must pass through.
The increasing steps seem to be quite constrained in their magnitude, compared to the decreasing steps. (This depends on how the "tendrils", i.e. the finite side-trees on the other side of the infinite trunk grow and reach their tops).

Crossrefs

Positions of zeros: A218607, A218605.

Programs

Formula

a(n) = A086876(n) - A218604(n) - 1.

Extensions

Offset changed because of the changed offset of A179016 - Antti Karttunen, Nov 10 2012

A218607 The positions of zeros in A218603, i.e., those integers i for which A179016(i) = A213708(i).

Original entry on oeis.org

0, 1, 3, 5, 8, 13, 22, 33, 35, 36, 37, 39, 50, 52, 53, 54, 55, 58, 69, 80, 82, 83, 84, 85, 88, 101, 118, 123, 134, 136, 137, 138, 139, 142, 155, 172, 179, 196, 207, 212, 221, 232, 234, 235, 236, 237, 240, 253, 270, 277, 294, 305, 310, 321, 338, 349, 354, 369, 374, 383, 400
Offset: 0

Views

Author

Antti Karttunen, Nov 10 2012

Keywords

Comments

These are the points i for which the corresponding node in the infinite trunk of beanstalk (A179016(i)) is at the least possible position of its allotted "window" which it at that point must pass through, i.e., there are no leaves or side-trees at its left (lesser) side at these points. (See comments at A218603.)

Crossrefs

Apart from first two terms, a subset of A213732. Cf. A218608, A218605.

A179016 The infinite trunk of binary beanstalk: The only infinite sequence such that a(n-1) = a(n) - number of 1's in binary representation of a(n).

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 11, 15, 16, 19, 23, 26, 31, 32, 35, 39, 42, 46, 49, 53, 57, 63, 64, 67, 71, 74, 78, 81, 85, 89, 94, 97, 101, 104, 109, 112, 116, 120, 127, 128, 131, 135, 138, 142, 145, 149, 153, 158, 161, 165, 168, 173, 176, 180, 184, 190, 193, 197, 200, 205, 209
Offset: 0

Views

Author

Carl R. White, Jun 24 2010

Keywords

Comments

a(n) tells in what number we end in n steps, when we start climbing up the infinite trunk of the "binary beanstalk" from its root (zero). The name "beanstalk" is due to Antti Karttunen.
There are many finite sequences such as 0,1,2; 0,1,3,4,7,9; etc. obeying the same condition (see A218254) and as the length increases, so (necessarily) does the similarity to this infinite sequence.

Crossrefs

A subsequence of A005187, i.e., a(n) = A005187(A213715(n)). For all n,
A071542(a(n)) = n, and furthermore A213708(n) <= a(n) <= A173601(n). (Cf. A218603, A218604).
Rows of A218254, when reversed, converge towards this sequence.
Cf. A276623, A219648, A219666, A255056, A276573, A276583, A276613 for analogous constructions, and also A259934.

Programs

  • Mathematica
    TakeWhile[Reverse@ NestWhileList[# - DigitCount[#, 2, 1] &, 10^3, # > 0 &], # <= 209 &] (* Michael De Vlieger, Sep 12 2016 *)

Formula

a(0)=0, a(1)=1, and for n > 1, if n = A218600(A213711(n)) then a(n) = (2^A213711(n)) - 1, and in other cases, a(n) = a(n+1) - A213712(n+1). (This formula is based on Carl White's observation that this iterated/converging path must pass through each (2^n)-1. However, it would be very interesting to know whether the sequence admits more traditional recurrence(s), referring to previous, not to further terms in the sequence in their definition!) - Antti Karttunen, Oct 26 2012
a(n) = A218616(A218602(n)). - Antti Karttunen, Mar 04 2013
a(n) = A054429(A233271(A218602(n))). - Antti Karttunen, Dec 12 2013

Extensions

Starting offset changed from 1 to 0 by Antti Karttunen, Nov 05 2012

A071542 Number of steps to reach 0 starting with n and using the iterated process : x -> x - (number of 1's in binary representation of x).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 02 2002

Keywords

Examples

			17 (= 10001 in binary) -> 15 (= 1111) -> 11 (= 1011) -> 8 (= 1000) -> 7 (= 111) -> 4 (= 100) -> 3 (= 11) -> 1 -> 0, hence a(17)=8.
		

Crossrefs

A179016 gives the unique infinite sequence whose successive terms are related by this iterated process (in reverse order). Also, it seems that for n>=0, a(A213708(n)) = a(A179016(n+1)) = n.
A213709(n) = a((2^(n+1))-1) - a((2^n)-1).

Programs

  • Mathematica
    Table[-1 + Length@ NestWhileList[# - DigitCount[#, 2, 1] &, n, # > 0 &], {n, 0, 75}] (* Michael De Vlieger, Jul 16 2017 *)
  • PARI
    for(n=1, 150, s=n; t=0; while(s!=0, t++; s=s-sum(i=1, length(binary(s)), component(binary(s), i))); if(s==0, print1(t, ", "); ); )
    
  • PARI
    a(n)=my(k);while(n,n-=hammingweight(n);k++);k \\ Charles R Greathouse IV, Oct 30 2012
    (MIT/GNU Scheme)
    ;; with memoizing definec-macro:
    (definec (A071542 n) (if (zero? n) n (+ 1 (A071542 (- n (A000120 n)))))) ;; Antti Karttunen, Oct 24 2012

Formula

a(0)=0, a(n) = 1 + A071542(n - A000120(n)). - Antti Karttunen, Oct 24 2012
It seems that a(n) ~ C n/log(n) asymptotically with C = 1.4... (n = 10^6 gives C = 1.469..., n = 10^7 gives C = 1.4614...).

Extensions

Starting offset changed to 0 with a(0) prepended as 0 by Antti Karttunen, Oct 24 2012

A173601 Greatest inverse of A071542, i.e., a(n) = maximal i such that A071542(i) = n.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 11, 15, 17, 19, 23, 27, 31, 33, 35, 39, 43, 47, 51, 55, 59, 63, 65, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 125, 127, 129, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 183, 189, 191, 195, 199, 203, 207
Offset: 0

Views

Author

Keywords

Comments

What is s = lim sup a(n)/(n log_2(n))? A counting argument suggests s >= 1/2, and in any case s <= 1.
Essentially also the partial sums of A086876. - Antti Karttunen, Nov 10 2012 (per personal mail from Carl R. White, Nov 02 2012)

Crossrefs

See A213708 for the least inverse. A086876 gives the first differences. Also, a(n)=A213708(n)+A086876(n)-1. Cf. A071542, A179016, A218604, A218608.

Programs

  • PARI
    v=vectorsmall(10^3);v[1]=1;for(n=2,#v,v[n]=v[n-hammingweight(n)]+1); u=vector(solve(x=1,#v,x*log(x)/log(2)-#v)\1);for(i=1,#v,if(v[i]<=#u,u[v[i]]=i)); u
    
  • Scheme
    ;; With Antti Karttunen's intseq-library:
    (define A173601 (PARTIALSUMS 1 0 (compose-funs A086876 1+)))

Formula

a(n)/log_2(a(n)) < n < a(n) for n > 1.

Extensions

Changed the starting offset by prepending a(0)=0 (with the indexing of the rest of terms thus not changed) - Antti Karttunen, Nov 10 2012

A218604 a(n) = A173601(n) - A179016(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 2, 0, 1, 0, 0, 1, 1, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3, 5, 0, 1, 0, 0, 1, 1, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3, 5, 1, 2, 2, 3, 2, 2, 0, 0, 0, 0, 1, 3, 2, 0, 1, 0, 0, 1, 1, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3, 5, 1, 2
Offset: 0

Views

Author

Antti Karttunen, Nov 03 2012

Keywords

Comments

For all n, the following holds: A213708(n) <= A179016(n) <= A173601(n). This sequence gives the distance of the node n in the infinite trunk of beanstalk (A179016(n)) from the greater edge of the A086876(n) wide window which it at that point must pass through.
The increasing steps seem to be quite constrained in their magnitude, compared to the decreasing steps. (This depends on how the "tendrils",i.e. the finite side-trees on the other side of the infinite trunk grow and reach their tops).

Crossrefs

Positions of zeros: A218608, A218606.

Programs

Formula

a(n) = A086876(n) - A218603(n) - 1.

Extensions

Offset changed because of the changed offset of A179016 - Antti Karttunen, Nov 10 2012

A086876 Run lengths in A071542.

Original entry on oeis.org

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

Views

Author

Ralf Stephan, Aug 21 2003

Keywords

Comments

All a(n) are even for n>1.
Although this can be viewed as a list, the indexing still starts from zero, because a(n) tells from how many starting values one can end to 0 in n steps, with the iterative process described in A071542 (if going around in 0->0 loop is disallowed). I.e., a(n) gives the number of all nodes (whether internal or leaves) in "beanstalk" (see A179016) from which the distance to the root (zero) is n.
Records occur at positions { 1,2,7,37,122,... } which correspond to run start positions { 2,4,16,126,512,... } in A071542.

Examples

			There is only one way to reach 0 in 0 steps from anywhere, and that is from 0 itself.
There is only one way to reach 0 in 1 steps from anywhere (with no 0->0 transition allowed), and that is from 1, as 1-A000120(1)=0.
There are two ways to reach 0 in 2 steps, from 2, as 2-A000120(2)=1, and 1-A000120(1)=0, and from 3, as 3-A000120(3)=1, and 1-A000120(1)=0.
Thus a(0)=a(1)=1 and a(2)=2.
		

Crossrefs

Essentially the first differences of both A173601 and A213708.

Programs

  • PARI
    e1(n)=sum(k=0, floor(log(n)/log(2)), bittest(n, k))
    f(n)=local(c); c=0; while(n, n=n-e1(n); c=c+1); c
    p=1; r=1; for(n=1, 150, c=0; while(f(r) == p, r=r+1; c=c+1); p=f(r); print1(c", "))

Extensions

Changed the starting offset by prepending a(0)=1 (with the indexing of the rest of terms thus not changed), as A071542 now contains an initial zero. - Antti Karttunen, Nov 02 2012

A219653 Least inverse of A219652; a(n) = minimal i such that A219652(i) = n.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 16, 20, 24, 26, 30, 34, 38, 42, 48, 52, 56, 60, 66, 72, 78, 84, 90, 96, 102, 108, 116, 120, 122, 126, 130, 134, 138, 144, 148, 152, 156, 162, 168, 174, 180, 186, 192, 198, 204, 212, 218, 226, 234, 240, 244, 248, 252, 258, 264, 270, 276
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Crossrefs

Cf. A219655 for the greatest inverse. A219654 gives the first differences.
This sequence is based on Factorial number system: A007623. Analogous sequence for binary system: A213708 and for Zeckendorf expansion: A219643. Cf. A219652, A219659, A219666.

A219643 Least inverse of A219642; a(n) = minimal i such that A219642(i) = n.

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 8, 10, 13, 15, 18, 21, 23, 26, 29, 32, 34, 36, 39, 42, 45, 47, 50, 54, 55, 57, 60, 63, 66, 68, 71, 75, 78, 81, 84, 89, 91, 94, 97, 100, 102, 105, 109, 112, 115, 118, 123, 126, 130, 134, 138, 143, 144, 146, 149, 152, 155, 157, 160, 164, 167
Offset: 0

Views

Author

Antti Karttunen, Nov 24 2012

Keywords

Crossrefs

Cf. A219645 for the greatest inverse. A219644 gives the first differences.
This sequence is based on Fibonacci number system (Zeckendorf expansion): A014417. For analogous sequence in binary system, see: A213708, for factorial number system: A219653.

A255053 Least inverse of A255072; a(n) = smallest k such that A255072(k) = n.

Original entry on oeis.org

0, 1, 3, 6, 7, 11, 14, 15, 19, 23, 27, 30, 31, 35, 39, 44, 47, 51, 55, 59, 62, 63, 67, 71, 76, 79, 86, 91, 95, 99, 103, 108, 111, 115, 119, 123, 126, 127, 131, 135, 140, 143, 150, 155, 159, 166, 172, 176, 182, 187, 191, 195, 199, 204, 207, 214, 219, 223, 227, 231, 236, 239, 243, 247, 251, 254, 255
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Also positions of records in A255072.

Crossrefs

Analogous sequences: A213708, A219643, A219653.

Formula

Other identities. For all n >= 0:
a(0) = 0; for n > 0: a(n) = a(n-1) + A255054(n-1).
a(n) = A255056(n) - A255123(n).
Showing 1-10 of 10 results.