%I #6 Aug 02 2023 13:48:40
%S 0,1,0,3,-1,1,2,-1,3,-1,9,3,-1,2,-1,-1,9,3,-1,-1,-1,9,5,-1,-1,-1,9,-1,
%T -1,-1,16,-1,9,9,-1,3,12,-1,-1,-1,18,-1,-1,9,-1,5,-1,-1,4,-1,9,-1,-1,
%U 9,-1,-1,-1,-1,-1,-1,-1,16,-1,-1,-1,9,-1,9,5,-1,-1,-1,19,12,-1,-1,-1,-1,33,-1,27
%N a(n) is the least k such that 1 + 2^k + 3^k is divisible by n, or -1 if there is no such k.
%C If a(n) = -1, then a(m) = -1 for all multiples of n.
%H Robert Israel, <a href="/A364683/b364683.txt">Table of n, a(n) for n = 1..10000</a>
%e a(7) = 2 because 1 + 2^2 + 3^2 = 14 is divisible by 7 while 1 + 2^0 + 3^0 = 3 and 1 + 2^1 + 3^1 = 6 are not.
%p f:= proc(n) local k;
%p for k from 0 to numtheory:-phi(n) + max(padic:-ordp(n,2), padic:-ordp(n,3)) do
%p if 1 + 2&^k + 3&^k mod n = 0 then return k fi
%p od;
%p -1
%p end proc:
%p map(f, [$1..100]);
%Y Cf. A001550.
%K sign,look
%O 1,4
%A _Robert Israel_, Aug 02 2023
|