OFFSET
1,1
COMMENTS
a(n) = n^2 - 1 if n > 1 is in A235868. - Robert Israel, Jan 17 2019
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000 (first 500 terms from Harvey P. Dale)
EXAMPLE
a(4)=7 because 7^2 - 1 is divisible by 4^2 (and 7 is the smallest integer > 1 that satisfies this criterion).
MAPLE
f:= n -> min(map(t -> rhs(op(t)), {msolve(k^2-1, n^2)}) minus {1}):
f(1):= 2:
map(f, [$1..100]); # Robert Israel, Jan 17 2019
MATHEMATICA
With[{c=Range[2, 10000]}, Flatten[Table[Select[c, Divisible[#^2-1, n^2]&, 1], {n, 60}]]] (* Harvey P. Dale, Oct 23 2011 *)
PROG
(PARI) { A100836(n)=local(f, b, t, m); if(n==1, return(1)); if(n==2, return(3)); t=valuation(n, 2); if(n==2^t, return(2^(2*t-1)-1)); f=factorint(n/2^t); f=vector(matsize(f)[1], j, f[j, 1]^(2*f[j, 2])); if(t>0, f=concat(f, [2^(2*t-1)])); b=n^2+1; forvec(v=vector(#f, i, [0, 1]), m=lift(chinese(vector(#f, j, Mod((-1)^v[j], f[j])))); if(m>1, b=min(b, m)); ); b } /* Max Alekseyev, Nov 21 2008 */
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Thomas Kerscher (Thomas.Kerscher(AT)web.de), Jan 19 2005
EXTENSIONS
STATUS
approved