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.

A357564 a(n) = n - 2*b(b(n)) for n >= 2, where b(n) = A006165(n).

This page as a plain text file.
%I A357564 #8 Oct 23 2022 23:35:45
%S A357564 0,1,2,1,2,3,4,3,2,3,4,5,6,7,8,7,6,5,4,5,6,7,8,9,10,11,12,13,14,15,16,
%T A357564 15,14,13,12,11,10,9,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
%U A357564 25,26,27,28,29,30,31,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,17,18,19,20,21,22,23
%N A357564 a(n) = n - 2*b(b(n)) for n >= 2, where b(n) = A006165(n).
%C A357564 a(n+1) - a(n) is equal to 1 or -1.
%C A357564 The following hold for k >= 0:
%C A357564 Local valley: at n = 5*(2^k) the sequence has a local minimum value of 2^k.
%C A357564 Ascent: on the interval [5*(2^k), 8*(2^k)] of length 3*(2^k) the line graph of the sequence has slope 1.
%C A357564 Local peak: at n = 8*(2^k) the sequence has a local maximum value of 4*(2^k).
%C A357564 Descent: on the interval [8*(2^k), 10*(2^k)] of length 2*(2^k) the line graph of the sequence has slope -1.
%C A357564 Local valley: at n = 10*(2^k) = 5*(2^(k+1)) the sequence has a local minimum value of 2^(k+1).
%H A357564 Peter Bala, <a href="/A357564/a357564.rtf">Notes on A357564</a>
%F A357564 a(2) = 0, a(3) = 1 and a(4) = 2. For k >= 0 there holds
%F A357564 a(5*2^k + j) = 2^k + j for 0 <= j <= 3*2^k and
%F A357564 a(8*2^k + j) = 4*2^k - j for 0 <= j <= 2*2^k.
%p A357564 # b(n) = A006165(n)
%p A357564 b := proc(n) option remember; if n = 1 then 1 else n - b(n - b(b(n-1))) end if; end proc:
%p A357564 seq( n - 2*b(b(n)), n = 2..100);
%Y A357564 Cf. A006165, A357562.
%K A357564 nonn,easy
%O A357564 2,3
%A A357564 _Peter Bala_, Oct 15 2022