I was messing around with this sieve, and I started thinking, could one find a closed form of such a sieve? And this sieve SCREAMED inclusion-exclusion principle. So after using this principle, I obtained the following: Let $\mathcal P$ denote the set of all primes $\leq x$. Then we have |$\mathcal P$|=[$x$]-$\lfloor \frac{x}{p_1} \rfloor$-$\lfloor \frac{x}{p_2} \rfloor$+$\lfloor \frac{x}{p_1p_2} \rfloor$+..., and we continue until we have added up all possible products of the primes, and subtracted all of the $\lfloor \frac{x}{p_i} \rfloor$. (We must also have that the maximum prime in this sequence must not exceed $\sqrt x$). Would this be a correct way for writing the sieve?
This thing came up in a combinatorics course I am taking.  Choose a fixed set of primes $p_1,p_2,\dots,p_k$ and let $A_n$ be number of integers in $\{1,2,\dots,n\}$ which are not divisible by any of the $p_i$'s. $A_n$ is given by $ n - \sum_{1\leq i_1 \leq k} \lfloor \frac{n}{p_{i_1}} \rfloor + \sum_{1\leq i_1 &lt; i_2 &lt; k} \lfloor \frac{n}{p_{i_1}p_{i_2}}\rfloor - \dots $. Now, if $n$ is divisible by each of the $p_i$'s then we have the simpler expression : $A_n = n \prod_{i=1}^{k}(1-\frac{1}{p_i})$(added later : note I am not assuming $n = \prod_{i=1}^{k}p_i$ here, this holds true whenever $n = c \prod_{i=1}^{k} p_i $ for some integer c, since each $\lfloor \frac{n}{p_{i_1} \dots p_{i_j}} \rfloor = \frac{n}{p_{i_1} \dots p_{i_j}}\ )$.  Another student pointed out that even if $n$ does not have $\prod_{i=1}^{k} p_i$ as a factor, the approximation $B_n = n \prod_{i=1}^{k}(1-\frac{1}{p_i})$ to $A_n$ is quite close in some specific cases. It is easy to see that $\lim_{n\to\infty}\frac{A_n - B_n}{n}=0$ as $\lim_{n\to\infty}\frac{1}{n}\lfloor \frac{n}{p_{i_1}p_{i_2}\dots p_{i_j}} \rfloor \to \frac{1}{p_{i_1}p_{i_2} \dots p_{i_j}},$ however that is not strong enough to imply that $A_n - B_n$ will be always close. Is there any way to analyze how well this approximation will perform in general? I am interested in the worst case for small to moderately sized $n$.  Just to give a feel of how close $A_n$ and $B_n$ can get, assuming the set of primes is $\{2,3,7\}$ we have (assuming my program is correct):  n     A(n)     B(n) 17    5    4.86   27    8    7.71   37    11      10.57   107   31      30.57   1111  318     317.43   3001  858     857.43   4007  1145    1144.86   5000  1429    1428.57 .
Atiyah-Macdonald, Exercise 8.3: Artinian iff finite k-algebra. Atiyah Macdonald, Exercise 8.3. Let $k$ be a field and $A$ a finitely generated $k$-algebra. Prove that the following are equivalent:   (1) $A$ is Artinian.   (2) $A$ is a finite $k$-algebra.   I have a question in the proof of (1$\Rightarrow$2): By using the structure theorem, we may assume that $(A,m)$ is an Artin local ring. Then $A/m$ is a finite algebraic extension of $k$ by . Since $A$ is Artinian, $m$ is the nilradical of $A$ and thus $m^n=0$ for some $n$. Thus we have a chain $A \supseteq m \supseteq m^2 \supseteq \cdots \supseteq m^n=0$. Since $A$ is Noetherian, $m$ is finitely generated and hence each $m^i/m^{i+1}$ is a finite dimensional $A/m$-vector space, hence a finite dimensional $k$-vector space.  But now how can I deduce that $A$ is a finite dimensional $k$-vector space? If one were to take a similar path as  in shooting candid street photography today, should they be concerned about laws or other realistic norms of today? I am wondering specifically in the US speaking broadly of all states. I am not looking for legal advice, but anything that one photographer to another would caution against as potentially being grey or obviously illegal.  Similar previous question: How do I return a variable from Google Maps JavaScript geocoder callback? Inner border over images with CSS? I don't really know much about entropy but I learned recently that the entropy in the universe is constantly increasing and that perhaps someday we will reach maximum entropy and the universe will end in heat death. In order for this to be true there are two prerequisites:   Heat must constantly be created. There must be no way to destroy heat (at least no way that turns it into a more useful form of energy).   1 is certainly true. Every process creates some heat. When a person walks his/her feet hit the ground with kinetic energy and the friction creates heat.   But I don't see how 2 can be true. For one thing, heat never even leaves its place of origin (earth, another planet or a star). In order for heat to travel in requires air (or some other conductor/convector). Since there is no air in space there is also no heat. Heat leaves things only in the form of electromagnetic radiation (light) (in the case of earth, infrared).   So conversion from heat to light is certainly possible and is even found in nature. Now how do we get from light to other forms of energy? Well, photosynthesis. Solar panels. So this is possible too. If so, why will we ever run out of useful energy? Even if the rest of the universe does, can't we still reharness our own energy by converting the heat to light and light to other forms of energy?  Suppose the sun died (and leave aside the fact that it would first destroy earth with a supernova), can't we just put up a huge solar panel around earth to pick up all the infrared and convert it back to useful energy? How to fix a grub boot error : "symbol 'grub_calloc' not found Just ran the latest batch of updates on 20.04 (Xubuntu), and now I'm getting a GRUB error: symbol 'grub_calloc' not found  I'm dropped into the 'grub rescue' shell, but have no idea what to do there that might be useful. To me, 'symbol not found' implies some sort of build error with the grub package, but I don't really know how grub works. I noticed that this update also included 'firmware', not sure if that could be related. Is my best bet just to boot from a live CD and see if I can roll back the update to grub somehow? Edited to add: OK, thanks to lots of people ! Here's what I think I now understand.  On 'non-UEFI' systems, grub is installed in two separate parts. The first, most basic, part is the part that is started on bootup. But for most of it's functionality, it needs the second part. These parts must be aligned - neither part must require any functionality from the other part which is not actually there. The visible, run-time problem occurs when these parts are not aligned, and the function grub_calloc is not supplied. It's not 100% clear to me if grub_calloc belongs in the second, larger part or the first. I would have expected the second, but the grub build system is a work of considerable art, so I don't know :).  The root cause of the problem is that the grub update has not ensured that both parts have been updated. Ideally, failure to do this should cause grub installation to fail, and the system should be reverted to a safe state. This does not happen. This is actually still a bit of a mystery to me. All that the update needs to do by default is put each part where the current parts are, because obviously that worked. If the install locations/drives are configuration - driven, and one of these locations can't be reached, then somehow a mismatch has arisen between that configuration data and reality. This might not show up as a problem as long as no new dependency was introduced between the parts.   All flavours of solution involve reinstalling grub to ensure that the two parts are aligned. It's not actually necessary to go back to the previous version ( although that will work ), because it's not the grub runtime per se that is broken. There are numerous ways to achieve this, depending on your environment, but running the Boot-repair live disk worked for me. It may be useful, for the purpose of avoiding such a misalignment in future, to ensure that the grub installer on your system is configured to install to the correct devices. This update resolves some important bugs (). If you have reverted grub to resolve this problem, be aware that you are exposed to these issues. Creating a selector from a method name with parameters I have a code sample that gets a SEL from the current object,   SEL callback = @selector(mymethod:parameter2);   And I have a method like    -(void)mymethod:(id)v1 parameter2;(NSString*)v2 { }   Now I need to move mymethod to another object, say myDelegate.  I have tried:  SEL callback = @selector(myDelegate, mymethod:parameter2);   but it won't compile. Is the subset $[0, \sqrt2] ∩\mathbb{Q} ⊂ \mathbb{Q}$ closed, bounded, compact? Letting $\mathbb{Q}$ be equipped with the Euclidean metric.  What I can work out is that it is bounded as its contained in the closed ball of radius ${\sqrt2}/{2}$ centred at ${\sqrt2}/{2} $.  Its not compact as it can be expressed as union of the two disjoint open sets $[0,{\sqrt2}/{2}) $and$ ({\sqrt2}/{2}, \sqrt2)$ (though I'm not sure if this makes it not compact in $\mathbb{Q}$ or just $\mathbb{R}$).  And its not closed as the sequence of truncations of $\sqrt2$ in $\mathbb{Q}$ converges to $\sqrt2$ Can I include the completion of Udacity and Coursera classes I have attended in an academic CV? Can I include in my academic CV that I have attended and completed the  and  classes I have been taking? I understand that these are not anything major, but the courses definitely gives a good overview and starting formal study on the subject becomes less cryptic. If I can include them without any negative impacts, then under what section should I include them? Why does prime factorization for LCM work? A method to finding the LCM of two numbers is to use prime factoring. I know how to do this, but logically why does this work in finding the lcm Polynomials vanishing on an infinite set I'd like some help making this argument complete and rigorous (if it's correct - if not, help with that would be nice).  Here $k$ is a field.     Let $A_1,\ldots,A_n \subseteq k$ be infinite subsets. Then any polynomial in $k[x_1,\ldots,x_n]$ that vanishes on $A_1\times\cdots\times A_n\subseteq k^n$ must be $0$ (as a polynomial).   This is what I have ...  For the case $n=1$, a non-constant polynomial can only have as many roots as its degree, and in particular, it must have a finite number of roots. The only polynomial in one variable that has an infinite number of roots is $0$, so if a polynomial in $k[x_1,\ldots,x_n]$ vanishes on an infinite subset then it must be $0$.  For the inductive step, suppose the proposition is true for less than $n$ subsets and variables. Let $p\in k[x_1,\ldots,x_n]$ vanish on $A_1\times\cdots\times A_n$. Fix $x_n$ as some $a\in A_n$, and we have a polynomial in $n-1$ variables that vanishes on the set $A_1\times\cdots\times A_{n-1}$, so by the inductive hypothesis it must be identically $0$.  (Now it gets sketchy). Since this is true for any of the infinite values in $A_n$, and , $p$ must be $0$. Rational solutions of $y^2 = x^3 - x$ ArcPy importing error after setting path? This questions has been asked before too and I did go through most of the suggestions. Things I have tried so far: setting up correct  path variable environment, installing anaconda 32 bits, python 2.7, or even switching to python 2.7 in cmd while initially using Anaconda 3 , adding Desktop 10.4.pth file with  following path.  C:\Program Files (x86)\ArcGIS\Desktop10.4\bin C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcToolBox\Scripts   I also added those paths in environment variable   These suggestions help me to reduce the error. But Now I am getting a different error. Looks like python can find arcpy but missing another package.  Getting this error while trying to import arcpy in python 3.6.   File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\__init__.py", line 22, in &lt;module&gt;     from arcpy.geoprocessing import gp    File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in &lt;module&gt;     from _base import *  ModuleNotFoundError: No module named '_base'   Any suggestions? Does anyone have a recommendation for a book to use for the self study of real analysis? Several years ago when I completed about half a semester of Real Analysis I, the instructor used "Introduction to Analysis" by Gaughan.   While it's a good book, I'm not sure it's suited for self study by itself.  I know it's a rigorous subject, but I'd like to try and find something that "dumbs down" the material a bit, then between the two books I might be able to make some headway. Custom question lists: finding questions you can answer OpenID support for Ruby on Rails application What is current state of the art for enabling OpenID login in Ruby on Rails applications?  This is a community wiki with up-to-date answers to this question. Authlogic The most advanced authentication solution seems to be .  It supports OpenID with .  It supports Rails 4 and 3. Rails 2 is supported in the rails2 branch. You may want to watch  (and the ). There is a sample application called . Devise Devise is flexible authentication framework for Rails.  It supports OpenID with . restful_authentication Another authentication library of choice is  Rails plugin.  Seems like you also need to install  plugin. You may want to watch (old, circa 2007) . Ruby OpenID Raw support for OpenID protocol is handled by  library. CPU time out limit was being hit while processing child records on the inline opportunity visualforce page, to handle this i wrote a remoteActionFunction on the page that invokes controller method that's taking long to process and when i get CPU LIMIT exception in the result, i am invoking javascript call back function that invokes a action function which handles the same code asynchronously(@future).  Question: by setting the timeout (Visualforce.remoting.timeout = 120000;) can't we overcome CPU TIME out limit of 10,000 ms. Possible Duplicate:          Sounds like a silly question, but bear with me..  If you go into Peet's Coffee and access the wifi, you're taken to a web page that requires a 4-digit code you get with a purchase.   If you do the same at Starbucks you're taken to a page and asked to OK the terms of service.   I want to build something similar for a local independent coffee shop, something that requires the user to write a little about themselves before they can access the Internet.  I'm not sure which way to go -- looking for wifi routers that run an internal web server, or finding one that lets you direct users to an external website for authentication, somehow redirecting back to the access point once successful.   Has anyone done anything like this and can share their experience? How do I kill mobs using /kill without them dropping loot? I have a spawn area I am hoping to make a safe haven, so I have a command block on a clock that kills each hostile mob type. This works to keep the place free of any hostile mobs, however every night I see rotten flesh, bones, arrows, and string everywhere.  I would like to add something to my command blocks so that they are killed without dropping loot. How can I accomplish this?  Note that I want mobs to drop loot generally elsewhere in the world, so /gamerule doMobLoot false will not do the trick for me. I'm hoping for a command that only applies to the mobs killed by the command block, and not anything else. To my understanding, this is the default configuration of /etc/crontab:  # m h dom mon dow user  command 17 *    * * *   root    cd / &amp;&amp; run-parts --report /etc/cron.hourly 25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily ) 47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly ) 52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )   Why were these specific times chosen for the default entries?  At first I assumed that they are somewhat randomized on installation to even out the system load, but that doesn't seem to be correct.