This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A028897 If n = Sum c_i 10^i then a(n) = Sum c_i 2^i. 11
 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 4 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS For n<100, this is the same result as "If n = Sum c_i 10^i then a(n) = Sum c_i (i+1)". - Henry Bottomley, Apr 20 2001 n_2 in the notation of A122618. LINKS Reinhard Zumkeller, Table of n, a(n) for n = 0..10000 Robin C. Yu, Decibinary Numbers, on Hackerrank.com. FORMULA a(n) = 2*a([n/10])+(n mod 10). - Henry Bottomley, Apr 20 2001 a(0) = 0, a(n) = 2*a(n/10) if n==0 (mod 10), a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 21 2002 For all n, a(A007088(n)) = n. - Antti Karttunen, Jun 22 2014 MATHEMATICA a[n_ /; n < 10] := n; a[n_] := a[n] = If[Mod[n, 10] != 0, a[n-1] + 1, 2*a[n/10]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 02 2016 *) PROG (PARI) a(n)=if(n<1, 0, if(n%10, a(n-1)+1, 2*a(n/10))) (PARI) A028897(n)=fromdigits(digits(n), 2) \\ M. F. Hasler, Feb 14 2019 (MIT/GNU Scheme) (define (A028897 n) (let loop ((z 0) (i 0) (n n)) (if (zero? n) z (loop (+ z (* (modulo n 10) (expt 2 i))) (1+ i) (floor->exact (/ n 10)))))) ;; Antti Karttunen, Jun 22 2014 (Haskell) a028897 0 = 0 a028897 n = 2 * a028897 n' + d where (n', d) = divMod n 10 -- Reinhard Zumkeller, Nov 06 2014 CROSSREFS Cf. A007088, A122618. Differs from A081594 and A244158 for the first time at n=100, which here is a(100) = 4. Cf. A249873, A072170. See A322000 for integers ordered according to the value of a(n). Sequence in context: A273005 A093017 A156230 * A244158 A322001 A081594 Adjacent sequences:  A028894 A028895 A028896 * A028898 A028899 A028900 KEYWORD nonn,base,easy,nice,look AUTHOR EXTENSIONS More terms from Erich Friedman. Terms up to n=100 added by Antti Karttunen, Jun 22 2014 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified October 19 03:24 EDT 2019. Contains 328211 sequences. (Running on oeis4.)