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.

A218450 Number of digits of n plus number of digits of n equal to 1, 2, 4, or 8.

This page as a plain text file.
%I A218450 #22 Aug 03 2021 20:23:28
%S A218450 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,
%T A218450 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,
%U A218450 2,2,3,3,2,3,2,2,2,3,2,3,4,4,3,4,3,3,3
%N A218450 Number of digits of n plus number of digits of n equal to 1, 2, 4, or 8.
%H A218450 Robert Israel, <a href="/A218450/b218450.txt">Table of n, a(n) for n = 1..10000</a>
%F A218450 lim inf a(n)/log_10 n = 1; lim sup a(n)/log_10 n = 2.
%p A218450 f:= proc(n) local L;
%p A218450   L:= convert(n,base,10);
%p A218450   nops(L) + numboccur(L,{1,2,4,8})
%p A218450 end proc:
%p A218450 map(f, [$1..100]); # _Robert Israel_, Apr 29 2021
%t A218450 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 *)
%t A218450 Table[IntegerLength[n]+Total[DigitCount[n,10,{1,2,4,8}]],{n,100}] (* _Harvey P. Dale_, Aug 03 2021 *)
%o A218450 (PARI) a(n) = my(d = digits(n)); #d + #select(x->((x==1) || (x==2) || (x==4) || (x==8)), d); \\ _Michel Marcus_, Jan 31 2016
%K A218450 nonn,easy,base
%O A218450 1,1
%A A218450 _David Williams_, Oct 28 2012