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.

This page as a plain text file.
%I A106747 #15 Apr 08 2022 08:14:27
%S A106747 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,
%T A106747 14,10,10,11,11,12,12,13,13,14,14,20,20,21,21,22,22,23,23,24,24,20,20,
%U A106747 21,21,22,22,23,23,24,24,30,30,31,31,32,32,33,33,34,34,30,30,31,31,32,32
%N A106747 Replace each odd digit d of n with (d-1)/2 and each even digit d with d/2.
%C A106747 Terms are repeated. Differs from A004526 and A021895 starting with a(11)=0, A004526(11)=A021895(11)=5.
%H A106747 Reinhard Zumkeller, <a href="/A106747/b106747.txt">Table of n, a(n) for n = 0..10000</a>
%t A106747 a[n_]:=FromDigits[Map[If[Mod[ #, 2]==1, (#-1)/2, #/2]&, IntegerDigits[n]]];Table[a[n], {n, 0, 100}]
%o A106747 (Haskell)
%o A106747 a106747 n = if n == 0 then 0 else 10 * (a106747 n') + div d 2
%o A106747             where (n', d) = divMod n 10
%o A106747 -- _Reinhard Zumkeller_, Jan 14 2015
%o A106747 (Python)
%o A106747 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
%Y A106747 Cf. A004526, A021895, A107128, A107130.
%K A106747 nonn,base,look
%O A106747 0,5
%A A106747 _Zak Seidov_, May 12 2005