OFFSET
1,5
FORMULA
a(n) = A065730(n) mod n.
EXAMPLE
MATHEMATICA
Table[PowerMod[Floor[Sqrt[Prime[n]]], 2, n], {n, 72}] (* Stefano Spezia, Jan 02 2022 *)
PROG
(PARI) a(n) = (sqrtint(prime(n))^2) % n;
vector(20, n, a(n))
(Ruby) require 'prime'
values = []
Prime.first(20).each_with_index do |prime, i|
values << ((Integer.sqrt(prime) ** 2) % (i + 1))
end
p values
(Python)
from sympy import prime, integer_nthroot
def a(n): return (integer_nthroot(prime(n), 2)[0]**2)%n
print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Jan 02 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Simon Strandgaard, Jan 01 2022
STATUS
approved