OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (first 1000 terms from Reinhard Zumkeller)
PROG
(Haskell)
import Data.List (findIndex)
import Data.Maybe (fromJust)
a080982 n = (+ 1) $ fromJust $
findIndex ((== 0) . (`mod` (n ^ 2))) $ tail a000217_list
-- Reinhard Zumkeller, Mar 23 2013
(Python 3.8+)
from itertools import combinations
from sympy import factorint
from sympy.ntheory.modular import crt
def A080982(n):
k = 2*n**2
plist = [p**q for p, q in factorint(k).items()]
return k-1 if len(plist) == 1 else min(min(crt([m, k//m], [0, -1])[0], crt([k//m, m], [0, -1])[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l))) # Chai Wah Wu, Jun 13 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 26 2003
STATUS
approved