A179801 Count of times n appears in number created by stringing together previous n-1 integers.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1
Offset: 1
Examples
a(6)=0 because stringing together the first 5 integers gives the number "12345" and 6 does not appear in 12345. a(12)=1 because stringing together the first 11 integers gives "1234567891011" and 12 appears once in 1234567891011 (right at the beginning).
Programs
-
Mathematica
Table[idn=IntegerDigits[n];fid=Flatten[IntegerDigits/@Range[n-1]];Count[ Partition[ fid,Length[idn],1],idn],{n,0,110}] (* Harvey P. Dale, Jul 22 2013 *) Table[SequenceCount[Flatten[IntegerDigits/@Range[n-1]],IntegerDigits[n]],{n,120}] (* Harvey P. Dale, Apr 16 2023 *)
-
PHP
for($x = 1; $x <= 1000; $x++) { echo "$x: " . substr_count($running, $x) ."
" ; $running = $running . $x ; }
Comments