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.

A121758 In decimal number system, take odd digits of n with negative sign.

This page as a plain text file.
%I A121758 #13 Jun 20 2017 12:24:38
%S A121758 -1,2,-3,4,-5,6,-7,8,-9,-10,-11,-8,-13,-6,-15,-4,-17,-2,-19,20,19,22,
%T A121758 17,24,15,26,13,28,11,-30,-31,-28,-33,-26,-35,-24,-37,-22,-39,40,39,
%U A121758 42,37,44,35,46,33,48,31,-50,-51,-48,-53,-46,-55,-44,-57,-42,-59,60,59,62,57,64,55,66,53,68,51,-70,-71,-68,-73,-66,-75,-64
%N A121758 In decimal number system, take odd digits of n with negative sign.
%C A121758 See A121759. In decimal number system, take even digits of n with negative sign.
%C A121758 a(n) = - A121759(n). [_Reinhard Zumkeller_, Sep 16 2011]
%H A121758 Reinhard Zumkeller, <a href="/A121758/b121758.txt">Table of n, a(n) for n = 1..10000</a>
%F A121758 If n = d(i)*10^(i-1), then a(n)=(-1)^d(i)*d(i)*10^(i-1).
%e A121758 a(12)=-8 because 12=1*10^1+2*10^0 and a(12)=(-1)^1*1*10^1+(-1)^2*2*10^0=-10+2=-8.
%t A121758 a[n_] := Total[MapIndexed[(-1)^#1*#1*10^(#2[[1]]-1)&, Reverse[ IntegerDigits[n] ] ] ]; Array[a, 76] (* _Jean-François Alcover_, Jun 20 2017 *)
%o A121758 (Haskell)
%o A121758 import Data.List (unfoldr)
%o A121758 a121758 = foldl (\v d -> 10 * v + d) 0 . reverse . unfoldr f where
%o A121758    f 0 = Nothing
%o A121758    f x | odd d     = Just (- d, x')
%o A121758        | otherwise = Just (d, x') where (x', d) = divMod x 10
%o A121758 -- _Reinhard Zumkeller_, Sep 16 2011
%Y A121758 Cf. A121759.
%K A121758 base,sign,nice,look
%O A121758 1,2
%A A121758 _Zak Seidov_, Aug 20 2006