$ 1^k + 2^k + \cdots + (p-1)^k \equiv \begin{cases} -1 \mod p, \text{ if } p-1 | k, \\ 0 \mod p, \text{ if } p-1 \not | k. \end{cases}$ If $p-1 | k \Rightarrow k = (p-1) n$, for some $n \in \mathbb{N}$. Then we $ 1^{(p-1)^n} + 2 ^{(p-1)^n} + \cdots + (p-1)^{(p-1)^n} = \underbrace{1 + 1 + \cdots + 1}_{p-1}  = p-1 \equiv -1 \mod p.$ The second part of the question did not come out. Induction: $k=1$, which is true because we $1 + 2 + \cdots + (p-1)= \frac{(p-1)(p)}{2} \equiv 0 \mod p$. Suppose true for $k = n$, then $1^n + 2^n + \cdots + (p-1)^n \equiv 0 \mod p$. How to finish? Thank you.
$1^n +2^n + \cdots +(p-1)^n \mod p =$? Calculate for every positive integer $n$ and for every prime $p$ the expression  $$1^n +2^n + \cdots +(p-1)^n \mod p$$    I need your help for this. I don't know what to do, but I'll show you what I know.   Wilson's theorem The identity $X^p-X = \prod_{a \in \mathbb{F}_p-1}(X-a)$ $\exists a \in \mathbb{Z}, \ a^2 \equiv -1 \mod p \qquad \iff \qquad p \equiv 1 \mod 4$   Now can you please provide me a hint?
Institute Name in @masterthesis Citations I need to cite master thesis and the lecture notes into a document. But the problem with @masterthesis and @unpublished citations is they don't print an institution name in the pdflatex output of bibliography.   `\documentclass{article}   \usepackage{filecontents}  \usepackage[ backend=biber, style=numeric, sortlocale=de_DE, natbib=true, url=true,  doi=true, eprint=false ]{biblatex} \addbibresource{bibliography.bib}  \begin{filecontents}{bibliography.bib} @masterthesis{bhgt, title={Bike Model}, author={Fris}, year={2016}, school={University A}, address={XXX} } @unpublished{Map, title = {Electrical Engineering Book}, author={Koch}, howpublished = {Lecture Notes}, Institution= {University B}, year = {2015} } } \end{filecontents}  \begin{document}  Citation Test:  \cite{bhgt} and \cite{Map} \printbibliography  \end{document}`   I get this bibliography output:         [1] Fris. Bike Model. XXX, 2016.   [2] Koch. “Electrical Engineering Book”. Lecture Notes. 2015.       Any suggestions, how we can also print an institute name? Consider the following Gaussian Integral $$I = \int_{-\infty}^{\infty} e^{-x^2} \ dx$$  The usual trick to calculate this is to consider $$I^2 = \left(\int_{-\infty}^{\infty} e^{-x^2} \ dx \right) \left(\int_{-\infty}^{\infty} e^{-y^{2}} \ dy \right)$$  and convert to polar coordinates. We get $\sqrt{\pi}$ as the answer.   Is it possible to get the same answer by considering $I^{3}, I^{4}, \dots, I^{n}$? CUDA Driver API vs. CUDA runtime When writing CUDA applications, you can either work at the driver level or at the runtime level as illustrated on this image (The libraries are CUFFT and CUBLAS for advanced math):   (source: )    I assume the tradeoff between the two are increased performance for the low-evel API but at the cost of increased complexity of code. What are the concrete differences and are there any significant things which you cannot do with the high-level API?  I am using CUDA.net for interop with C# and it is built as a copy of the driver API. This encourages writing a lot of rather complex code in C# while the C++ equivalent would be more simple using the runtime API. Is there anything to win by doing it this way? The one benefit I can see is that it is easier to integrate intelligent error handling with the rest of the C# code. Combining |- and !.5! in TikZ How do I combine the !.5! operator with the -| operator?  I want a node that has x-coordinate equal to the average of x coordinates of nodes A and B, and a y-coordinate equal to the average the y coordinates of nodes C and D. Which is correct: "has died" or "died"? To me, using Present Perfect form means the event can occur again. So, saying      someone has died   may not be grammatically correct.  Also, I noticed (it might be just coincidence):     passed away   is used more often than     has passed away   Is using Present Perfect correct here? states:  "In practice, explicit right outer joins are rarely used, since they can always be replaced with left outer joins and provide no additional functionality."  Can anyone provide a situation where they have preferred to use the RIGHT notation, and why? I can't think of a reason to ever use it. To me, it wouldn't ever make things more clear.  Edit: I'm an Oracle veteran making the New Year's Resolution to wean myself from the (+) syntax. I want to do it right Favourites Page on iOS App I would like to have a page listing all the questions I marked as favourite, same as the .  Also, I think the desktop version, the star, is much more intuitive and easier to find. Thanks! How do I know if food left at room temperature is still safe to eat? Forgot which email I used, can't login I forgot what email I used for my other ploxtic id: how do you find out what my email was?   The account is user:2078229. How to handle calendar TimeZones using Java? I have a Timestamp value that comes from my application. The user can be in any given local TimeZone.  Since this date is used for a WebService that assumes the time given is always in GMT, I have a need to convert the user's parameter from say (EST) to (GMT). Here's the kicker: The user is oblivious to his TZ. He enters the creation date that he wants to send to the WS, so what I need is:  User enters: 5/1/2008 6:12 PM (EST)  The parameter to the WS needs to be: 5/1/2008 6:12 PM (GMT)  I know TimeStamps are always supposed to be in GMT by default, but when sending the parameter, even though I created my Calendar from the TS (which is supposed to be in GMT), the hours are always off unless the user is in GMT. What am I missing?  Timestamp issuedDate = (Timestamp) getACPValue(inputs_, "issuedDate"); Calendar issueDate = convertTimestampToJavaCalendar(issuedDate); ... private static java.util.Calendar convertTimestampToJavaCalendar(Timestamp ts_) {   java.util.Calendar cal = java.util.Calendar.getInstance(       GMT_TIMEZONE, EN_US_LOCALE);   cal.setTimeInMillis(ts_.getTime());   return cal; }   With the previous Code, this is what I get as a result (Short Format for easy reading):  [May 1, 2008 11:12 PM] Why is a geometric progression called so? Just curious about why geometric progression is called so. Is it related to geometry? Render result is completely blank I have a master's degree in International Studies, and a double major with Computer Science from undergrad.  My transcripts suck.  There's no other way to dress it up.  I have pretty good teaching experience, and my GRE scores are awesome, and I suspect my recommendations are as bland as everyone else's.  Basically, to an admissions committee, I suspect I'm the model of a student who is probably smart enough but didn't work hard enough.  I want to do a Ph.D. in Political Science, but the response from my applications is looking pretty grim.  Am I permanently out of the running, or is there something I can do for the next few years which will help to counterbalance my unfavorable GPA? Exponent and abelian groups Help me understand adjusted odds ratio in logistic regression I've been having a hard time trying to understand the use of logistic regression in a paper. The paper available  uses logistic regression to predict probability of complications during cataract surgery.   What is confusing me is that the paper presents a model that assigns odds ratio of 1 to baseline described as follows:     A patient whose risk profile was in the reference group for all risk indicators (ie adjusted OR=1.00 for all in Table 1) may be regarded as having a ‘baseline risk profile’, and the logistic regression model indicates a ‘baseline predicted probability’ for PCR or VL or both=0.736%.   So the probability of 0.00736 is presented with odds ratio of 1. Based on the transformation from probabilities to odds ratios: $o=\frac{p}{1-p}$, this can't be equal to 1:  $0.00741=\frac{0.00736}{1-0.00736}$.  It gets even more confusing. The composite odds ratios that represents multiple covariates having values different than the baseline is used to calculate predicted risk.      ...the composite OR from Table 1 would be 1.28 X 1.58 X 2.99 X 2.46 X   1.45 X 1.60 = 34.5, and from the graph in Figure 1, we see that this OR corresponds with a predicted probability of PCR or VL or both of around 20%   The only way to arrive at the values the paper is giving as examples is to multiply the baseline probability with composite odds like this: $0.2025=\frac{(34.50\ \times\ 0.00736)}{1\ +\ (34.50\ \times\ 0.00736)}$.  So what is going on here? What is the logic for assigning odds ratio 1 to a baseline probability that is not 0.5? The update formula I've came up with above comes up with the right probabilities for examples in the paper but this is not the direct multiplication of odds ratio I'd expect. What is it then? I bought a new SSD with 750 GB and made two partitions: 600 GB and 150 GB. The smaller one was thought to be a Bootcamp partition one day, but to date it was just another unused partition. When I needed more space, I decided to merge these two partitions. The partition was created with Mavericks, the merge was done with Yosemite.  I opened Disk Utility and the "minus" button. Disk Utility told me both partitions would be merged then. However it miserably failed. My main hard disc suddenly had errors which couldn't be repaired and even two of my other external hard discs could not be mounted any longer.  I eventually restored the hard disc from Time Machine, which worked well.  My second partition is now listed as free:    Unfortunately I can't resize the 600 GB partition nor can I create a new partition using the free space.  Diskutil reveils the following:  ~  diskutil list /dev/disk0    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *750.2 GB   disk0    1:                        EFI EFI                     209.7 MB   disk0s1    2:          Apple_CoreStorage                         599.6 GB   disk0s2    3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3 /dev/disk1    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:                  Apple_HFS Macintosh HD           *599.3 GB   disk1                                  Logical Volume on disk0s2                                  XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX                                  Unencrypted   Also diskutil brought up this:  ~  diskutil cs list CoreStorage logical volume groups (1 found) | +-- Logical Volume Group 9D2BA4BA-xxxx-xxxx-xxxx-xxxxxxxxxxxx     =========================================================     Name:         Macintosh HD     Status:       Online     Size:         599640592384 B (599.6 GB)     Free Space:   6111232 B (6.1 MB)     |     +-&lt; Physical Volume 29A9A02B-xxxx-xxxx-xxxx-xxxxxxxxxxxx     |   ----------------------------------------------------     |   Index:    0     |   Disk:     disk0s2     |   Status:   Online     |   Size:     599640592384 B (599.6 GB)     |     +-&gt; Logical Volume Family 2FA7892F-xxxx-xxxx-xxxx-xxxxxxxxxxxx         ----------------------------------------------------------         Encryption Status:       Unlocked         Encryption Type:         None         Conversion Status:       NoConversion         Conversion Direction:    -none-         Has Encrypted Extents:   No         Fully Secure:            No         Passphrase Required:     No         |         +-&gt; Logical Volume 7BF42B7B-xxxx-xxxx-xxxx-xxxxxxxxxxxx             ---------------------------------------------------             Disk:                  disk1             Status:                Online             Size (Total):          599282155520 B (599.3 GB)             Conversion Progress:   -none-             Revertible:            No             LV Name:               Macintosh HD             Volume Name:           Macintosh HD             Content Hint:          Apple_HFS   I have tried this:    fsck -fy (The volume Macintosh HD appears to be OK.)   but it wouldn't help. It said I couldn't recover because it wasn't created in a way it would support (sorry for missing the exact message).  I then have learned that Apple_CoreStorage might indicate my disk is encrypted, which might explain why I can't resize it. It doesn't explain why I can't create a new partition to me.  What are my options to make my hard disk available in a single partition with size 750 GB? I was surprised recently to find that it's possible to have a return statement in a finally block in Java.  It seems like lots of people think it's a bad thing to do as described in ''. Scratching a little deeper, I also found '' which shows some pretty horrible examples of other types of flow control in finally blocks.  So, my question is, can anyone give me an example where a return statement (or other flow control) in a finally block produces better / more readable code? Why is Grub menu not shown when starting my computer? I am a new user of Ubuntu 12.04.   I installed Ubuntu and Windows XP, and I want to use both operating systems. When I restart or boot my PC the GRUB menu does not appear.  How can I solve this problem? Do I need a Turkey transit visa for a layover? Default constructor with empty brackets Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?  MyObject  object;  // ok - default ctor MyObject  object(blah); // ok  MyObject  object();  // error   I seem to type "()" automatically everytime. Is there a good reason this isn't allowed?