The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A218450 Number of digits of n plus number of digits of n equal to 1, 2, 4, or 8. 1
 2, 2, 1, 2, 1, 1, 1, 2, 1, 3, 4, 4, 3, 4, 3, 3, 3, 4, 3, 3, 4, 4, 3, 4, 3, 3, 3, 4, 3, 2, 3, 3, 2, 3, 2, 2, 2, 3, 2, 3, 4, 4, 3, 4, 3, 3, 3, 4, 3, 2, 3, 3, 2, 3, 2, 2, 2, 3, 2, 2, 3, 3, 2, 3, 2, 2, 2, 3, 2, 2, 3, 3, 2, 3, 2, 2, 2, 3, 2, 3, 4, 4, 3, 4, 3, 3, 3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 LINKS Robert Israel, Table of n, a(n) for n = 1..10000 FORMULA lim inf a(n)/log_10 n = 1; lim sup a(n)/log_10 n = 2. MAPLE f:= proc(n) local L;   L:= convert(n, base, 10);   nops(L) + numboccur(L, {1, 2, 4, 8}) end proc: map(f, [\$1..100]); # Robert Israel, Apr 29 2021 MATHEMATICA Table[d = IntegerDigits[n]; Length[d] + Count[d, 1] + Count[d, 2] + Count[d, 4] + Count[d, 8], {n, 100}] (* T. D. Noe, Nov 16 2012 *) Table[IntegerLength[n]+Total[DigitCount[n, 10, {1, 2, 4, 8}]], {n, 100}] (* Harvey P. Dale, Aug 03 2021 *) PROG (PARI) a(n) = my(d = digits(n)); #d + #select(x->((x==1) || (x==2) || (x==4) || (x==8)), d); \\ Michel Marcus, Jan 31 2016 CROSSREFS Sequence in context: A297382 A258257 A086600 * A025912 A029441 A342263 Adjacent sequences:  A218447 A218448 A218449 * A218451 A218452 A218453 KEYWORD nonn,easy,base AUTHOR David Williams, Oct 28 2012 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 December 1 22:12 EST 2021. Contains 349435 sequences. (Running on oeis4.)