A073454 Number of repeated remainders arising when n is divided by all primes up to n: a(n) = pi(n) - A073453(n).
0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 2, 3, 3, 3, 2, 2, 2, 2, 1, 2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 4, 3, 3, 2, 3, 2, 2, 2, 2, 2, 3
Offset: 1
Keywords
Examples
n=25: Primes are (2,3,5,7,11,13,17,19,23), remainders are (1,1,0,4,3,12,8,6,2), distinct remainders are {0,1,2,3,4,6,8,12} which has 8 members, so a(25) = 9 - 8 = 1.
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Table[PrimePi[w]-Length[Union[Table[Mod[w, Prime[j]], {j, 1, PrimePi[w]}]]], {w, 1, 256}]
-
PARI
a(n) = my(P=primes([2, n])); #P - #Set(apply(p->n%p, P)) \\ Charles R Greathouse IV, Jun 17 2016
Formula
See program below.
Extensions
New name from Charles R Greathouse IV, Jun 17 2016
Comments