OFFSET
1,2
COMMENTS
a(n) is the least number x such that x^2 + 1 and 2^x + 1 are both divisible by the n-th number k for which there exists x such that x^2 + 1 and 2^x + 1 are both divisible by k.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n)^2 == 2^a(n) == -1 (mod A387595(n)).
EXAMPLE
a(3) = 18 because A387595(3) = 13, 18^2 == 2^18 == -1 (mod 13), and no smaller number works.
MAPLE
f:= proc(n) local a, b, x, y, t, tt;
uses NumberTheory;
if n::even then return -1 fi;
a:=[msolve(x^2 + 1 = 0, n)];
if a = [] then return -1 fi;
a:= map(t -> rhs(op(t)), a);
b:=msolve(2^x + 1 = 0, t, n);
if b = {} or b = NULL then return -1 fi;
b:= rhs(op(b));
tt:= indets(b)[1];
subs(infinity=-1, min(map(proc(s) local r; r:= ChineseRemainder([s, subs(tt=0, b)], [n, coeff(b, tt)]); if r = FAIL then +infinity else r fi end proc, a)));
end proc:
f(1):= 0:
subs(-1=NULL, map(f, [$1..1000]));
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 04 2025
STATUS
approved
