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.

A106747 Replace each odd digit d of n with (d-1)/2 and each even digit d with d/2.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 30, 30, 31, 31, 32, 32
Offset: 0

Views

Author

Zak Seidov, May 12 2005

Keywords

Comments

Terms are repeated. Differs from A004526 and A021895 starting with a(11)=0, A004526(11)=A021895(11)=5.

Crossrefs

Programs

  • Haskell
    a106747 n = if n == 0 then 0 else 10 * (a106747 n') + div d 2
                where (n', d) = divMod n 10
    -- Reinhard Zumkeller, Jan 14 2015
    
  • Mathematica
    a[n_]:=FromDigits[Map[If[Mod[ #, 2]==1, (#-1)/2, #/2]&, IntegerDigits[n]]];Table[a[n], {n, 0, 100}]
  • Python
    def A106747(n): return int(str(n).translate({49:48,50:49,51:49,52:50,53:50,54:51,55:51,56:52,57:52})) # Chai Wah Wu, Apr 07 2022