login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268372 Number of distinct primes (n mod k) for k=1..floor(n/2). 3

%I #8 Feb 11 2016 08:09:20

%S 0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,1,3,2,2,1,2,1,4,2,3,2,4,2,4,2,3,2,3,2,

%T 5,2,5,3,4,3,6,2,5,2,5,2,6,2,5,3,6,3,7,3,6,3,7,4,8,3,7,4,7,3,8,2,8,4,

%U 7,4,9,3,8,4,8,4,9,2,9,5,8,5,9,3,8,4

%N Number of distinct primes (n mod k) for k=1..floor(n/2).

%H Clark Kimberling, <a href="/A268372/b268372.txt">Table of n, a(n) for n = 1..1000</a>

%e For k=1..15, the numbers (31 mod k) are 0, 1, 1, 3, 1, 1, 3, 7, 4, 1, 9, 7, 5, 3, 1; the primes are 3,3,7,7,5,3, so that a(31) = 3.

%t t[n_] := Table[Mod[n, k], {k, 1, Floor[n/2]}]

%t p[n_] := DeleteDuplicates[Select[t[n], PrimeQ[#] &]]

%t Table[Length[p[n]], {n, 1, 200}]

%o (PARI) a(n) = #vecsort(select(x->isprime(x), vector(n\2, k, n % k)),,8); \\ _Michel Marcus_, Feb 04 2016

%Y Cf. A266714, A266715.

%K nonn,easy

%O 1,11

%A _Clark Kimberling_, Feb 03 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:33 EDT 2024. Contains 371969 sequences. (Running on oeis4.)