OFFSET
1,11
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(11) = 2 because 11 == 3 (mod 2^2) and 11 == 2 (mod 3^2), and 2 and 3 are prime.
MAPLE
f:= proc(n) local k; nops(select(isprime, [seq(n mod k^2, k=2..floor(sqrt(n)))])) end proc:
map(f, [$1..100]);
MATHEMATICA
a[n_] := Select[Range[2, Sqrt[n] // Floor], PrimeQ[Mod[n, #^2]]&] // Length;
Array[a, 100] (* Jean-François Alcover, Jul 17 2020 *)
PROG
(Magma) a:=[]; for n in [1..100] do Append(~a, #[k:k in [2..Floor(Sqrt(n))]| IsPrime(n mod k^2) ]); end for; a; // Marius A. Burtea, Nov 11 2019
(PARI) a(n) = sum(j=2, sqrtint(n), isprime(n % j^2)); \\ Michel Marcus, Nov 11 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Nov 09 2019
STATUS
approved