This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A260187 #60 Jul 03 2018 22:45:14 %S A260187 0,0,1,0,1,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4, %T A260187 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28, %U A260187 29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0 %N A260187 a(n) = n modulo the greatest primorial <= n. %C A260187 I think this can help in finding prime numbers. %C A260187 If n>2 and a(n)=0 then n is not prime. %C A260187 If n>2 and 2 <= a(n) <= p with p = A006530(A260188(n)) (i.e., greatest prime factor of A260188(n)) then n is not prime. %C A260187 If n>2 and (a(n) mod k) = 0 and 2 <= k <= p with p = A006530(A260188(n)) (i.e., greatest prime factor of A260188(n)) then n is not prime. %C A260187 Alternative definition: count up from 0 to primorial(n)-1, prime(n+1)-1 times, where primorial(n) is A002110(n). - _Franklin T. Adams-Watters_, Jul 20 2015 %H A260187 Jean-Marc Rebert, <a href="/A260187/b260187.txt">Table of n, a(n) for n = 1..40000</a> (first 10000 terms from Charles R Greathouse IV) %F A260187 a(n) = n mod A260188(n). %F A260187 a(n) <= (n+1)/2. - _Charles R Greathouse IV_, Jul 20 2015 %e A260187 a(5) = 1 because 5 modulo 2# = 1 and 2# = 2 is the greatest primorial <= 5. (3# = 2*3 = 6 > 5) %p A260187 N:= 100: # to get a(1) to a(N) %p A260187 P:= 1: p:= 2: R:= 2: %p A260187 for n from 1 to N do %p A260187 if n >= R then %p A260187 P:= R; p:= nextprime(p); R:= P*p; %p A260187 fi; %p A260187 A[n]:= n mod P; %p A260187 od: %p A260187 seq(A[i],i=1..N); # _Robert Israel_, Jul 20 2015 %t A260187 s = Product[Prime@ n, {n, #}] & /@ Range[0, 6]; Table[Mod[n, Last@ Select[s, # <= n &]], {n, 120}] (* _Michael De Vlieger_, Jul 20 2015 *) %t A260187 f[n_] := Block[{m = p = 1}, While[p*(m + 1) <= n, p = p*m; m = NextPrime@ m]; Mod[n, p]]; Array[f, 101] (* _Robert G. Wilson v_, Jul 21 2015 *) %o A260187 (PARI) a(n)=my(t=1, k); forprime(p=2, , k=t*p; if(k>n, return(n%t), t=k)) \\ _Charles R Greathouse IV_, Jul 20 2015 %Y A260187 Cf. A034386 and A002110 (primorials), A260188, A257687. %K A260187 nonn %O A260187 1,8 %A A260187 _Jean-Marc Rebert_, Jul 18 2015