OFFSET
1,2
COMMENTS
Conjecture 1: a(n) = 0 only for n = 1, 3, 4, 5, 14, 22. In other words, if p is a prime not among 2, 5, 7, 11, 43, 79, then there are k and m among 1,...,p-1 with k*m == 1 (mod p) such that k + m is a square.
We have verified this for all primes p < 4*10^7.
Conjecture 2: For any prime p > 18, there are k and m among 1,...,p-1 with k*m == 1 (mod p) such that k + m is a triangular number.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(9) = 17 with 17*19 == 1 (mod prime(9)=23) and 17 + 19 = 6^2.
a(16) = 28 with 28*36 == 1 (mod prime(16)=53) and 28 + 36 = 8^2.
MATHEMATICA
p[n_]:=p[n]=Prime[n]; SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
tab={}; Do[Do[If[SQ[k+PowerMod[k, -1, p[n]]], tab=Append[tab, k]; Goto[aa]], {k, 1, p[n]-1}]; tab=Append[tab, 0]; Label[aa], {n, 1, 100}]; Print[tab]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, May 22 2019
STATUS
approved