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 A072762 #50 Feb 16 2025 08:32:46 %S A072762 0,1,3,6,13,26,53,106,212,424,849,1698,3397,6794,13588,27176,54353, %T A072762 108706,217413,434826,869652,1739304,3478609,6957218,13914436, %U A072762 27828872,55657744,111315488,222630977,445261954,890523909,1781047818,3562095636,7124191272 %N A072762 n coded as binary word of length=n with k-th bit set iff k is prime (1<=k<=n), decimal value. %C A072762 a(n) is odd iff n is prime. %C A072762 a(p) where p is prime is the numerator of Sum_{q <= p} 1/2^q where the sum is over primes up to p. - _Alexander Adamchuk_, Aug 22 2006 %C A072762 The n-th approximation to the Prime Constant is given by a(n)/2^n. - Anton Vrba (antonvrba(AT)yahoo.com), Nov 24 2006 %H A072762 Alois P. Heinz, <a href="/A072762/b072762.txt">Table of n, a(n) for n = 1..3323</a> (first 300 terms from T. D. Noe) %H A072762 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeConstant.html">Prime Constant</a>. %F A072762 a(1) = 0 and a(n) = a(n-1)*2 + A010051(n) for n>1. %F A072762 a(n) = (1/2)*(pi(n) + Sum_{i=1..n} 2^(n-i)*pi(i)), where pi = A000720. - _Ridouane Oudra_, Aug 26 2019 %F A072762 a(n) = floor(c*2^n), where c = A051006 is the prime constant. - _Lorenzo Sauras Altuzarra_, Jan 03 2023 %e A072762 a(6) = '011010' = (((0*2+1)*2+1)*2*2+1)*2 = 26. %e A072762 a(7) = '0110101' = (((0*2+1)*2+1)*2*2+1)*2*2+1 = 53. %e A072762 a(8) = '01101010' = ((((0*2+1)*2+1)*2*2+1)*2*2+1)*2 = 106. %p A072762 a:= proc(n) option remember; %p A072762 `if`(n<2, 0, 2 * a(n-1) + `if`(isprime(n), 1, 0)) %p A072762 end: %p A072762 seq(a(n), n=1..40); # _Alois P. Heinz_, Jan 18 2011 %t A072762 a[1] = 0; a[n_] := a[n] = 2*a[n-1] + Boole[PrimeQ[n]]; Table[a[n], {n, 1, 31}] (* _Jean-François Alcover_, Jun 14 2013 *) %t A072762 nxt[{n_,a_}]:={n+1,Boole[PrimeQ[n+1]]+2a}; Transpose[NestList[nxt,{1,0},30]][[2]] (* _Harvey P. Dale_, Jan 07 2015 *) %o A072762 (PARI) an=0; print1(an,", "); for(n=2,31, an=2*an+isprime(n); print1(an,", ")) \\ _Washington Bomfim_, Jan 18 2011 %o A072762 (PARI) a(n)=my(s=1,p=2);forprime(q=3,n,s=s<<(q-p)+1;p=q);s<<(n-p) \\ _Charles R Greathouse IV_, Jun 03 2013 %o A072762 (Haskell) %o A072762 a072762 n = foldl (\v d -> 2*v + d) 0 $ map a010051 [1..n] %o A072762 -- _Reinhard Zumkeller_, Sep 17 2011 %Y A072762 Cf. A051006, A100634, A010051, A000720, A118255. %K A072762 nonn,nice,base %O A072762 1,3 %A A072762 _Reinhard Zumkeller_, Aug 08 2002