cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A380036 Smallest number which is not a triangular number mod n.

This page as a plain text file.
%I A380036 #32 Jan 30 2025 13:53:24
%S A380036 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,
%T A380036 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,
%U A380036 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
%N A380036 Smallest number which is not a triangular number mod n.
%C A380036 a(n) is the smallest nonnegative integer not in row n of A343713. - _Pontus von Brömssen_, Jan 11 2025
%e A380036 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.
%p A380036 f:= proc(n) local k;
%p A380036      if n = 2^padic:-ordp(n,2) then return n fi;
%p A380036      for k from 2 to n-1 do if NumberTheory:-QuadraticResidue(1+8*k,2*n)=-1 then return k fi od:
%p A380036      FAIL
%p A380036 end proc:
%p A380036 map(f, [$1..200]); # _Robert Israel_, Jan 10 2025
%o A380036 (PARI) a(n)=setminus([1..n], Set(vector(n,k,k*(k-1)/2)%n))[1] \\ _Andrew Howroyd_, Jan 10 2025
%Y A380036 Cf. A000079, A000217, A117484, A343713.
%K A380036 nonn
%O A380036 1,2
%A A380036 _Ethan E. Wood_, Jan 10 2025