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

A233268 The middle point of row n in binary beanstalk related sequences A179016, A218602, A218616, A233270, A233271.

Original entry on oeis.org

1, 2, 3, 6, 10, 17, 30, 53, 95, 171, 310, 564, 1036, 1918, 3574, 6691, 12566, 23653, 44610, 84309, 159698, 303253, 577352, 1102121, 2109448, 4047967, 7787277, 15015347, 29011671, 56150867, 108825599, 211127246, 409886210, 796134319, 1546848744, 3006198333, 5843799964
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2013

Keywords

Comments

a(n) points to the center of each palindromic row/subrange of A233270, and to the lower position nearest to the center, if the length of range is even.
For all n, A218602(a(n)) = a(n) + (1-A000035(A213709(n-1))).

Crossrefs

Formula

a(n) = floor((A213710(n-1) + A218600(n)) / 2).
a(n) = A218600(n-1) + ceiling((A213709(n-1)/2)).

A234020 Offsets from the middle point of each row of A233270 to the nearest point containing a maximum value of that range.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 3, 0, 5, 0, 0, 33, 72, 140, 267, 502, 954, 1771, 3355
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2013

Keywords

Comments

Please see the graph of A233270. Iff a(n)=0, A234018(n) = A234019(n).
Seems to grow faster than A233274. Is the ratio a(n)/A233274(n) converging to some limit?

Crossrefs

Programs

  • Scheme
    (define (A234020 n) (let ((middle (A233268 n))) (let loop ((i middle) (m 0) (maxp middle)) (cond ((zero? (A233270 i)) (- middle maxp)) ((> (abs (A233270 i)) m) (loop (- i 1) (abs (A233270 i)) i)) (else (loop (- i 1) m maxp))))))

A234018 Values at middle points of each row of A233270: a(n) = A233270(A233268(n)).

Original entry on oeis.org

0, -1, 0, 1, 1, 3, 3, 19, 35, 67, 127, 218, 369, 660, 1267, 2476, 4863, 9453, 18078, 34173, 64374, 121515, 227965, 426603, 793638, 1482307, 2764957, 5183333, 9830514
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2013

Keywords

Comments

Please see the graph of A233270.

Crossrefs

Programs

  • Scheme
    (define (A234018 n) (A233270 (A233268 n)))
    ;; Iterative version, which computes for values a(n>=4) in a single pass:
    (define (A234018v2 n) (cond ((zero? n) 0) ((< n 4) (A234018 n)) (else (let* ((memosize (if (< n 8) 2 (+ 2 (expt 2 (- n 8))))) (memo (make-vector memosize 0))) (let loop ((u (- (A000079 n) 1)) (d (A000079 (- n 1))) (i 0) (j #f) (du #f)) (cond ((pow2? u) (let ((offset (- (floor->exact (/ i 2)) du))) (- (A054429 (vector-ref memo offset)) (vector-ref memo (+ offset (A000035 i)))))) ((and (< u d) (not j)) (vector-set! memo 0 u) (loop (A011371 u) (A233272 d) (+ i 1) 1 i)) (else (if (and j (< j memosize)) (vector-set! memo j u)) (loop (A011371 u) (A233272 d) (+ i 1) (and j (+ 1 j)) du))))))))
    (define (pow2? n) (let loop ((n n) (i 0)) (cond ((zero? n) #f) ((odd? n) (and (= 1 n) i)) (else (loop (/ n 2) (1+ i))))))

Formula

a(n) = A233270(A233268(n)).

A234019 Maximum values occurring in each row of A233270: a(n) = A233270(A233268(n) - A234020(n)).

Original entry on oeis.org

0, -1, 0, 1, 2, 4, 6, 19, 38, 67, 127, 234, 419, 745, 1378, 2678, 5311, 10470, 20333
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2013

Keywords

Comments

Please see the graph of A233270.

Crossrefs

Formula

a(n) = A233270(A233268(n) - A234020(n)).

A233271 a(0)=0; thereafter a(n+1) = a(n) + 1 + number of 0's in binary representation of a(n), counted with A080791.

Original entry on oeis.org

0, 1, 2, 4, 7, 8, 12, 15, 16, 21, 24, 28, 31, 32, 38, 42, 46, 49, 53, 56, 60, 63, 64, 71, 75, 79, 82, 87, 90, 94, 97, 102, 106, 110, 113, 117, 120, 124, 127, 128, 136, 143, 147, 152, 158, 162, 168, 174, 178, 183, 186, 190, 193, 199, 203, 207, 210, 215, 218, 222
Offset: 0

Views

Author

Antti Karttunen, Dec 12 2013

Keywords

Comments

These are iterates of A233272: a(0)=0, and for n>0, a(n) = A233272(a(n-1)). The difference from A216431 stems from the fact that it uses A023416 to count the 0-bits in the binary expansion of n, while this sequence uses A080791, which results a slightly different start for the iteration, and a much better alignment with sequences related to "infinite trunk of binary beanstalk", A179016.
Apart from term a(2)=2, it seems that each term a(n) >= A179016(n). Please see their ratio plotted with Plot2, and also their differences: A233270.

Crossrefs

Differs from A216431 only in that here 1 has been inserted into position a(1), between 0 and 2.

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = If[n == 1, 1, # + 1 + Last@ DigitCount[#, 2] &@ a[n - 1]]; Table[a@ n, {n, 0, 59}] (* or *)
    Insert[NestList[# + 1 + DigitCount[#, 2, 0] &, 0, nn], 1, 2] (* Michael De Vlieger, Mar 07 2016, the latter after Harvey P. Dale at A216431 *)

Formula

a(0)=0, and for n>0, a(n) = A233272(a(n-1)).
a(0)=0, and for n>0, a(n) = a(n-1) + 1 + A080791(a(n-1)).
a(n) = A054429(A218616(n)) = A054429(A179016(A218602(n))) [This sequence can be mapped to the infinite trunk of "binary beanstalk" with involutions A054429 & A218602].
For all n, a(A213710(n)) = 2^n = A000079(n).
For n>=3, a(A218600(n)) = A000225(n).

A257806 a(n) = A257808(n) - A257807(n).

Original entry on oeis.org

0, -1, 0, 1, 0, 1, 2, 1, 2, 1, 2, 3, 2, 3, 4, 5, 6, 5, 4, 5, 6, 5, 6, 5, 4, 3, 4, 3, 4, 5, 4, 5, 6, 7, 6, 5, 6, 7, 6, 7, 8, 7, 6, 7, 8, 9, 10, 11, 12, 11, 12, 13, 12, 11, 10, 9, 10, 9, 10, 11, 10, 11, 12, 13, 12, 11, 12, 13, 12, 13, 12, 13, 14, 13, 12, 11, 10, 9, 10, 11, 12, 11, 10, 9, 10, 11, 12, 13, 14, 15, 14, 15, 16, 15, 16, 15, 14
Offset: 0

Views

Author

Antti Karttunen, May 12 2015

Keywords

Comments

Alternative description: Start with a(0) = 0, and then to obtain each a(n), look at each successive term in the infinite trunk of inverted binary beanstalk, from A233271(1) onward, subtracting one from a(n-1) if A233271(n) is odd, and adding one to a(n-1) if A233271(n) is even.
In other words, starting from zero, iterate the map x -> {x + 1 + number of nonleading zeros in the binary representation of x}, and note each time whether the result is odd or even: With odd results go one step down, and even results go one step up.
After the zeros at a(0), a(2) and a(4) and -1 at a(1), the terms stay strictly positive for a long time, although from the terms of A257805 it can be seen that the sequence must again fall to the negative side somewhere between n = 541110611 and n = 1051158027 (i.e., A218600(33) .. A218600(34)). Indeed the fourth zero occurs at n = 671605896, and the second negative term right after that as a(671605897) = -1.
The maximum positive value reached prior to the slide into negative territory is 2614822 for a(278998626) and a(278998628). - Hans Havermann, May 23 2015

Examples

			We consider 0 to have no nonleading zeros, so first we get to 0 -> 0+1+0 = 1, and 1 is odd, so we go one step down from the starting value a(0)=0, and thus a(1) = -1.
1 has no nonleading zeros, so we get 1 -> 1+1+0 = 2, and 2 is even, so we go one step up, and thus a(2) = 0.
2 has one nonleading zero in binary "10", so we get 2 -> 2+1+1 = 4, and 4 is also even, so we go one step up, and thus a(3) = 1.
4 has two nonleading zeros in binary "100", so we get 4 -> 4+2+1 = 7, 7 is odd, so we go one step down, and thus a(4) = 0.
		

Crossrefs

Cf. also A218542, A218543, A218789 and A233270 (compare the scatter plots).

Programs

Formula

a(n) = A257808(n) - A257807(n).
a(0) = 0; and for n >= 1, a(n) = a(n-1) + (-1)^A233271(n).
Other identities. For all n >= 0:
a(A218600(n+1)) = -A257805(n).

A004074 a(n) = 2*A004001(n) - n, where A004001 is the Hofstadter-Conway $10000 sequence.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 3, 2, 3, 2, 1, 0, 1, 2, 3, 4, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 7, 8, 7, 6, 7, 8, 7, 8, 7, 6, 7, 6, 5, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 11, 12, 11, 10, 11, 12, 13, 12, 13, 14, 13, 14, 13, 12
Offset: 1

Views

Author

Keywords

Comments

The sequence is 0 at 2^n for n = 1, 2, 3, ... The maximum value between 2^n and 2^(n+1) appears to be A072100(n). - T. D. Noe, Jun 04 2012
Hofstadter shows the plot of sequence A004001(n)-(n/2) at point 10:52 of the part two of DIMACS lecture. This sequence is obtained by doubling those values, thus producing only integers. Cf. also A249071. - Antti Karttunen, Oct 22 2014

Crossrefs

Cf. also A249071 (gives the even bisection halved), A233270 (also has a similar Blancmange curve appearance).

Programs

  • Mathematica
    Clear[a]; a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Table[2*a[n] - n, {n, 100}] (* T. D. Noe, Jun 04 2012 *)
  • Scheme
    (define (A004074 n) (- (* 2 (A004001 n)) n)) ;; Other code as in A004001. - Antti Karttunen, Oct 22 2014

Formula

a(2^n)=0; for n >= 1, Sum_{i=2^(n-1)..2^n} a(i) = A082590(n-2). - Benoit Cloitre, Jun 04 2004

Extensions

More terms from Benoit Cloitre, Jun 04 2004

A249071 a(n) = A004001(2*n) - n, where A004001 is Hofstadter-Conway $10000 sequence.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 1, 0, 1, 2, 2, 2, 2, 2, 1, 0, 1, 2, 2, 3, 3, 4, 4, 3, 4, 4, 3, 3, 2, 2, 1, 0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 5, 6, 6, 7, 7, 6, 7, 7, 6, 6, 5, 6, 6, 5, 5, 4, 4, 3, 3, 2, 1, 0, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 9, 9, 10, 10, 11, 11, 10, 11, 11, 12, 12, 11, 12, 12, 11, 11, 10, 11, 11, 12, 12, 11, 12, 12, 11, 11, 10, 11, 11, 10, 10, 9, 9, 8, 8, 8, 8, 8, 7, 7, 6, 5, 5, 4, 3, 3, 2, 1, 0
Offset: 1

Views

Author

Antti Karttunen, Oct 22 2014

Keywords

Comments

Hofstadter shows the plot of function A004001(n)-(n/2) at time 10:52 during the part two of DIMACS lecture. This sequence is obtained as the bisection of that function, thus containing only integers. Cf. also A004074.

Crossrefs

Cf. also A233270 (also has a similar Blancmange curve appearance).

Formula

a(n) = A004001(2*n) - n.
a(n) = A004074(2*n) / 2. [Also the even bisection of A004074 halved.]

A233274 Relative offsets from the middle point of each row of A233271 & A218616 to the first point where the former exceeds the latter, which apart of case a(3)=-1 is always left of or at the middle point.

Original entry on oeis.org

0, 0, -1, 0, 0, 0, 0, 1, 2, 4, 8, 13, 22, 38, 68, 125, 232, 429, 786, 1428, 2578, 4645, 8364, 15064, 27145, 48990, 88736, 161813, 298001, 555451, 1048207, 1999608, 3844722, 7425094, 14356699, 27722560, 53374986
Offset: 1

Views

Author

Antti Karttunen, Jan 01 2014

Keywords

Comments

The sequence tells how many positions to the left of center of each row/subrange (of irregular tables like A233270, central point given by A233268) the sequences A233271 and A218616 cross each other (please see the linked graph).

Crossrefs

Programs

Formula

a(1)=a(2)=0, and for n > 2, a(n) = ⌈(A213709(n-1)/2)⌉ - A226060(n-2) - 1. Where ⌈x⌉ stands for ceiling(x)

A269397 Permutation of natural numbers: a(1) = 1, a(A233271(1+n)) = A179016(1+a(n)), a(A269390(n)) = A213713(a(n)), where A179016, A233271 are the infinite trunks of binary beanstalk and inverted binary beanstalk and A213713, A269390 their complements.

Original entry on oeis.org

1, 3, 2, 7, 6, 5, 4, 16, 13, 12, 10, 15, 9, 27, 11, 8, 22, 21, 18, 25, 46, 17, 43, 35, 20, 14, 36, 32, 34, 29, 26, 42, 40, 69, 28, 65, 54, 23, 33, 24, 55, 85, 50, 52, 45, 31, 41, 62, 19, 60, 100, 44, 67, 95, 80, 64, 37, 51, 38, 53, 82, 122, 78, 158, 75, 77, 68, 48, 61, 91, 49, 30, 88, 143, 145, 66, 98, 136, 116, 115, 93, 63, 56, 76, 58, 79, 39
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2016

Keywords

Crossrefs

Inverse: A269398.
Related or similar permutations: A269391, A269401, A269402.
Cf. also A233270.

Formula

a(1) = 1, for n > 1, if A269381(n) - A269381(n-1) > 0 [when n is in A233271] a(n) = A179016(1+a(A269381(n)-1)), otherwise a(n) = A213713(a(n-A269381(n))).
As a composition of related permutations:
a(n) = A269402(A269391(n)).
Showing 1-10 of 12 results. Next