VOOZH about

URL: https://oeis.org/A394398

⇱ A394398 - OEIS


login
A394398
Number of integers k, 1<= k < n, such that n|(k^2-1) and k|n^2-1.
1
0, 1, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
OFFSET
1,3
COMMENTS
From Robert Israel, Mar 19 2026: (Start)
k=n and k=n-1 always work, so a(n) >= 2 for n > 2.
If n = x*(x+2), then k = x+1 works, so a(n) >= 3 if x > 1.
Also if n = x*(x^2-2), then k = x^2-1 works, so again a(n) >= 3 if x > 1. (End)
LINKS
Srikanth Cherukupally, On the size of {a : 1 <= a < n, n|a^2 - 1, a|n^2 - 1} for number n, arXiv:2603.17434 [math.NT], 2026.
FORMULA
a(n) is the number of divisors d of n^2-1 such that d<n and n divides d^2-1. - Chai Wah Wu, Mar 19 2026
MAPLE
f:= proc(n) local k; nops(select(t -> n^2-1 mod t = 0, NumberTheory:-RootsOfUnity(2, n))) end proc:
f(1):= 0:
map(f, [$1..100]); # Robert Israel, Mar 19 2026
MATHEMATICA
a[n_]:=Sum[Boole[Mod[k^2-1, n]==0&&Mod[n^2-1, k]==0], {k, 1, n-1}] Table[a[n], {n, 1, 120}] (* Vincenzo Librandi, Mar 21 2026 *)
PROG
(PARI) a(n) = sum(k=1, n-1, !((k^2-1) % n) && !((n^2-1)%k));
(Python)
from itertools import takewhile
from sympy import divisors
def A394398(n): return sum(1 for d in takewhile(lambda x:x<n, divisors(n**2-1)) if not (d**2-1)%n) # Chai Wah Wu, Mar 19 2026
(Python)
from sympy import sqrt_mod
def A394398(n): return sum(1 for d in sqrt_mod(1, n, all_roots=True) if not (n**2-1)%d) if n>1 else 0 # Chai Wah Wu, Mar 20 2026, after Robert Israel
(Magma) a := function(n) s := 0; for k in [1..n-1] do if ((k^2-1) mod n eq 0) and ((n^2-1) mod
k eq 0) then s +:= 1; end if; end for; return s; end function; [a(n) : n in [1..120]]; // Vincenzo Librandi, Mar 21 2026
CROSSREFS
Sequence in context: A262954 A262813 A360964 * A188794 A161966 A187188
KEYWORD
nonn
AUTHOR
Michel Marcus, Mar 19 2026
STATUS
approved