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.

A322131 In the decimal expansion of n, replace each digit d with 2*d.

This page as a plain text file.
%I A322131 #33 Feb 27 2020 23:20:18
%S A322131 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,210,212,214,216,218,40,42,44,
%T A322131 46,48,410,412,414,416,418,60,62,64,66,68,610,612,614,616,618,80,82,
%U A322131 84,86,88,810,812,814,816,818,100,102,104,106,108,1010,1012,1014
%N A322131 In the decimal expansion of n, replace each digit d with 2*d.
%C A322131 This is an operation on digit strings: 1066 becomes 201212, for example. 86420 becomes 1612840. The result is always even - see A330336. - _N. J. A. Sloane_, Dec 17 2019
%C A322131 This sequence is a variant of A124108 in decimal base.
%H A322131 Robert Israel, <a href="/A322131/b322131.txt">Table of n, a(n) for n = 0..10000</a>
%F A322131 A061581(n+1) = a(A061581(n)).
%F A322131 A066686(a(n), a(k)) = a(A066686(n, k)) for any n > 0 and k > 0.
%F A322131 a(10*n + d) = 10*a(n) + 2*d for any n >= 0 and d = 0..4.
%F A322131 a(10*n + d) = 100*a(n) + 2*d for any n >= 0 and d = 5..9.
%F A322131 G.f. g(x) satisfies g(x) = (2*x + 4*x^2 + 6*x^3 + 8*x^4 + 10*x^5 + 12*x^6 + 14*x^7 + 16*x^8 + 18*x^9)/(1-x^10) + (10 + 10*x + 10*x^2 + 10*x^3 + 10*x^4 + 100*x^5 + 100*x^6 + 100*x^7 + 100*x^8 + 100*x^9)*g(x^10). - _Robert Israel_, Nov 28 2018
%e A322131 For n = 109:
%e A322131 - we replace "1" with "2", "0" with "0" and "9" with "18",
%e A322131 - hence a(109) = 2018.
%p A322131 f:= proc(n) option remember;
%p A322131 local m,d;
%p A322131 d:= n mod 10; m:= floor(n/10);
%p A322131 if d >= 5 then 100*procname(m) + 2*d
%p A322131 else 10*procname(m)+2*d
%p A322131 fi
%p A322131 end proc:
%p A322131 f(0):= 0:
%p A322131 map(f, [$0..100]); # _Robert Israel_, Nov 28 2018
%t A322131 a[n_] := FromDigits@Flatten@IntegerDigits[2*IntegerDigits[n]]; Array[a, 60, 0] (* _Amiram Eldar_, Nov 28 2018 *)
%o A322131 (PARI) a(n, base=10) = my (d=digits(n, base), v=0); for (i=1, #d, v = v*base^max(1,#digits(2*d[i],base)) + 2*d[i]); v
%o A322131 (Python)
%o A322131 def A322131(n):
%o A322131    return int(''.join(str(int(d)*2) for d in str(n))) # _Chai Wah Wu_, Nov 29 2018
%Y A322131 Cf. A048385, A061581, A066686, A124108, A330336.
%K A322131 nonn,base,easy,look
%O A322131 0,2
%A A322131 _Rémy Sigrist_, Nov 27 2018