login
A380036
Smallest number which is not a triangular number mod n.
0
1, 2, 2, 4, 2, 2, 2, 8, 2, 2, 2, 2, 4, 2, 2, 16, 5, 2, 4, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 32, 2, 5, 2, 2, 2, 4, 2, 2, 2, 2, 4, 2, 2, 2, 4, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 64, 2, 2, 5, 5, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 7, 2, 2, 4, 2, 2, 4, 2, 2, 2, 2, 4
OFFSET
1,2
COMMENTS
a(n) is the smallest nonnegative integer not in row n of A343713. - Pontus von Brömssen, Jan 11 2025
EXAMPLE
For n=5, the triangular numbers mod 5 are the set {0,1,3} and the smallest number not in that set is a(5) = 2.
MAPLE
f:= proc(n) local k;
if n = 2^padic:-ordp(n, 2) then return n fi;
for k from 2 to n-1 do if NumberTheory:-QuadraticResidue(1+8*k, 2*n)=-1 then return k fi od:
FAIL
end proc:
map(f, [$1..200]); # Robert Israel, Jan 10 2025
PROG
(PARI) a(n)=setminus([1..n], Set(vector(n, k, k*(k-1)/2)%n))[1] \\ Andrew Howroyd, Jan 10 2025
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Ethan E. Wood, Jan 10 2025
STATUS
approved