Step 1: Differentiate the curve.
Given curve is
\[
\left(\frac{x}{a}\right)^n+\left(\frac{y}{b}\right)^n=2
\]
Differentiate with respect to \(x\):
\[
n\left(\frac{x}{a}\right)^{n-1}\frac{1}{a}
+
n\left(\frac{y}{b}\right)^{n-1}\frac{1}{b}\frac{dy}{dx}=0
\]
At the point \((a,b)\),
\[
\frac{x}{a}=1,\qquad \frac{y}{b}=1
\]
So,
\[
\frac{n}{a}+\frac{n}{b}\frac{dy}{dx}=0
\]
\[
\frac{dy}{dx}=-\frac{b}{a}
\]
Step 2: Write the tangent at \((a,b)\).
The tangent has slope
\[
-\frac{b}{a}
\]
Equation of tangent at \((a,b)\) is
\[
y-b=-\frac{b}{a}(x-a)
\]
Simplifying,
\[
\frac{x}{a}+\frac{y}{b}=2
\]
Step 3: Compare with the given line.
The given line is
\[
x\cos\alpha+y\sin\alpha=p
\]
Dividing by \(p\),
\[
\frac{x\cos\alpha}{p}+\frac{y\sin\alpha}{p}=1
\]
The tangent equation
\[
\frac{x}{a}+\frac{y}{b}=2
\]
can be written as
\[
\frac{x}{2a}+\frac{y}{2b}=1
\]
Comparing coefficients,
\[
\frac{\cos\alpha}{p}=\frac{1}{2a}
\]
and
\[
\frac{\sin\alpha}{p}=\frac{1}{2b}
\]
Thus,
\[
\cos\alpha=\frac{p}{2a}
\]
and
\[
\sin\alpha=\frac{p}{2b}
\]
Step 4: Use \(\sin^2\alpha+\cos^2\alpha=1\).
\[
\left(\frac{p}{2a}\right)^2+\left(\frac{p}{2b}\right)^2=1
\]
\[
\frac{p^2}{4}\left(\frac{1}{a^2}+\frac{1}{b^2}\right)=1
\]
\[
\frac{1}{a^2}+\frac{1}{b^2}=\frac{4}{p^2}
\]
Comparing with
\[
\frac{1}{a^2}+\frac{1}{b^2}=\frac{k}{p^2},
\]
we get
\[
k=4
\]
Step 5: Final conclusion.
Hence,
\[
\boxed{4}
\]
which corresponds to option (1).