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.
%I A222222 #34 Feb 01 2025 23:19:22 %S A222222 0,5,2,3,4,1,6,7,8,9,50,55,52,53,54,51,56,57,58,59,20,25,22,23,24,21, %T A222222 26,27,28,29,30,35,32,33,34,31,36,37,38,39,40,45,42,43,44,41,46,47,48, %U A222222 49,10,15,12,13,14,11,16,17,18,19,60,65,62,63,64,61,66,67,68,69,70,75,72,73,74,71 %N A222222 In the number n, replace all (decimal) digits '1' with '5' and vice versa. %C A222222 The map which is applied to primes in A171024. %H A222222 Matthew L. LaSelle, <a href="/A222222/b222222.txt">Table of n, a(n) for n = 0..9999</a> (first 1000 terms from Alois P. Heinz) %F A222222 Recurrence: a(10*n+i) = 10*a(n)+g(i) for 0 <= i <= 9, where %F A222222 g(x) = -13/10080*x^9 +43/840*x^8 -611/720*x^7 +457/60*x^6 -57739/1440*x^5 +5007/40*x^4 -62231/280*x^3 +13941/70*x^2 -319/5*x. - _Robert Israel_, May 13 2014 %p A222222 a:= proc(n) local m, d; d:=irem(n, 10, 'm'); %p A222222 `if`(n=0, 0, parse(cat(a(m),`if`(d in [1, 5], 6-d, d)))) %p A222222 end: %p A222222 seq(a(n), n=0..99); # _Alois P. Heinz_, Mar 02 2013 %t A222222 a[n_]:= IntegerDigits[n]/.{1->5, 5->1} // FromDigits; Table[a[n], {n, 0, 80}] (* _Vincenzo Librandi_, Jul 30 2013 *) %o A222222 (PARI) A222222(n,d=[0,5,2,3,4,1,6,7,8,9])=sum(i=1, #n=digits(n), d[n[i]+1]*10^(#n-i)) \\ gives correct value for n=0 iff d[1]=0, since digits(0)=[] in PARI (v.2.6) %o A222222 (Haskell) %o A222222 a222222 = foldl f 0 . map (read . return) . show :: Integer -> Integer %o A222222 where f v d = 10 * v + if d == 1 || d == 5 then 6 - d else d %o A222222 -- _Reinhard Zumkeller_, Jan 29 2014 %Y A222222 Cf. A222210-A222254; A171013-A171016, A175770, A171018-A171057. %K A222222 nonn,base,easy,look %O A222222 0,2 %A A222222 _M. F. Hasler_, Feb 12 2013