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.
%I A047778 #65 Sep 30 2024 12:52:38 %S A047778 1,6,27,220,1765,14126,113015,1808248,28931977,462911642,7406586283, %T A047778 118505380540,1896086088653,30337377418462,485398038695407, %U A047778 15532737238253040,497047591624097297,15905522931971113522,508976733823075632723,16287255482338420247156 %N A047778 Concatenation of the first n numbers in binary (converted to base 10). %C A047778 The smallest prime in this sequence is 485398038695407. What is the full subsequence of primes? - _N. J. A. Sloane_, Oct 03 2015 %C A047778 There is only the one prime in the first 22400 terms, making a second prime > 10^91000. - _Hans Havermann_, Oct 07 2015 %H A047778 Joe B. Stephen, <a href="/A047778/b047778.txt">Table of n, a(n) for n = 1..400</a> (terms 1..250 from Reinhard Zumkeller) %F A047778 a(n) = a(n-1)*2^(1+floor(log_2(n))) + n. - _Henry Bottomley_, Jan 12 2001 %F A047778 a(n) = 4C / 2^frac(log_2(n)) * n^{n+1} / r(frac(log_2(n)))^n + O(1), where r(x) = 2^{x - 1 + 2^{1-x}}; frac is the fractional part function frac(x) = x - floor(x); and C is the binary Champernowne constant (A066716). (In fact, a(n) is the floor of this expression; the error term is between 1/2 and 1.) r(x) takes on values between e*log(2) and 2 for x in the range 0 to 1. It follows using Stirling's approximation that the radius of convergence for the e.g.f. is log 2. - _Franklin T. Adams-Watters_, Sep 07 2006 %e A047778 a(4) = 1 10 11 100 [base 2] = 220 [base 10]. %p A047778 conc:= (x,y) -> x*2^(1+ilog2(y))+y: %p A047778 a[1]:= 1: %p A047778 for n from 2 to 30 do a[n]:= conc(a[n-1],n) od: %p A047778 seq(a[n],n=1..30); # _Robert Israel_, Oct 07 2015 %t A047778 If[STARTPOINT==1,n={},n=Flatten[IntegerDigits[Range[STARTPOINT-1],2]]]; Table[AppendTo[n,IntegerDigits[w,2]];n=Flatten[n];FromDigits[n,2],{w,STARTPOINT,ENDPOINT}] (* _Dylan Hamilton_, Aug 04 2010 *) %t A047778 f[n_] := FromDigits[ Flatten@ IntegerDigits[ Range@n, 2], 2]; Array[f, 18] (* _Robert G. Wilson v_, Nov 07 2010 *) %t A047778 Module[{n = 1}, NestList[#*2^BitLength[++n] + n &, 1, 25]] (* _Paolo Xausa_, Sep 30 2024 *) %o A047778 (Haskell) %o A047778 a047778 = (foldl (\v d -> 2*v + d) 0) . concatMap (reverse . unfoldr %o A047778 (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2)) . %o A047778 enumFromTo 1 %o A047778 -- _Reinhard Zumkeller_, Feb 19 2012 %o A047778 (PARI) cb(a,b)=a<<#binary(b) + b %o A047778 a(n)=fold(cb, [1..n]) \\ _Charles R Greathouse IV_, Jun 21 2017 %o A047778 (PARI) A047778_vec(N=20,s)=vector(N,k,s=s<<logint(k*2,2)+k) \\ _M. F. Hasler_, Oct 25 2019 %o A047778 (Python) %o A047778 def a(n): return int("".join([(bin(i))[2:] for i in range(1, n+1)]), 2) %o A047778 print([a(n) for n in range(1, 19)]) # _Michael S. Branicky_, Jan 06 2021 %o A047778 (Python) %o A047778 from functools import reduce %o A047778 def A047778(n): return reduce(lambda i,j:(i<<j.bit_length())+j,range(n+1)) # _Chai Wah Wu_, Feb 26 2023 %Y A047778 Cf. A001855 (bit counts, offset by 1), A061168, A066716. %Y A047778 Concatenation of first n numbers in other bases: 2: this sequence, 3: A048435, 4: A048436, 5: A048437, 6: A048438, 7: A048439, 8: A048440, 9: A048441, 10: A007908, 11: A048442, 12: A048443, 13: A048444, 14: A048445, 15: A048446, 16: A048447. %K A047778 easy,nonn,base,nice %O A047778 1,2 %A A047778 Aaron Gulliver (gulliver(AT)elec.canterbury.ac.nz) %E A047778 More terms from _Patrick De Geest_, May 15 1999 %E A047778 Name edited by _Joe B. Stephen_, Jul 22 2023