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.

A350091 a(n) = a(floor(n/4)) for n == 2 (mod 4), otherwise n.

Original entry on oeis.org

0, 1, 0, 3, 4, 5, 1, 7, 8, 9, 0, 11, 12, 13, 3, 15, 16, 17, 4, 19, 20, 21, 5, 23, 24, 25, 1, 27, 28, 29, 7, 31, 32, 33, 8, 35, 36, 37, 9, 39, 40, 41, 0, 43, 44, 45, 11, 47, 48, 49, 12, 51, 52, 53, 13, 55, 56, 57, 3, 59, 60, 61, 15, 63, 64, 65, 16, 67, 68, 69, 17, 71, 72, 73
Offset: 0

Views

Author

Ruud H.G. van Tol, Dec 14 2021

Keywords

Comments

a(n) deletes any trailing '10' bit pairs from n. So in base 4, it removes all trailing '2' digits.

Examples

			Numbers between '' are in base 2: '0'->'0', so a(0)=0. '110'->'1', so a(6)=1. '1010'->'10' -> '0', so a(10)=0. a(floor((2^1000001)/3))=0.
		

Crossrefs

Cf. A006519, A139391, A001511, A065883 (chop trailing 00 bit pairs), A347840.

Programs

  • Mathematica
    a[n_] := a[n] = If[Mod[n, 4] == 2, a[(n - 2)/4], n]; Array[a, 100, 0] (* Amiram Eldar, Dec 14 2021 *)
  • PARI
    a(n) = if(2!=(n%4), n, my(m=3*n+2); m=m/4^valuation(m,4);(m+1)/3-1)

Formula

A139391(2*a(n)+1) = A139391(2*n+1).
Sum_{k=1..n} a(k) ~ 2 * n^2 / 5. - Amiram Eldar, Aug 30 2024
a(n) = (A347840(n+1) - 1)/2. - Alan Michael Gómez Calderón, Dec 08 2024