OFFSET
0,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..2310
FORMULA
MATHEMATICA
{0}~Join~Table[k = 1; While[! CoprimeQ[Prime@ k, n], k++]; Mod[n, Product[Prime@ i, {i, k}]], {n, 79}] (* Michael De Vlieger, Jun 22 2017 *)
PROG
(Scheme, two versions)
(define (A276094 n) (if (zero? n) n (let loop ((n n) (i 1) (pr 1)) (let* ((p (A000040 i)) (d (modulo n p))) (if (not (zero? d)) (* d pr) (loop (/ (- n d) p) (+ 1 i) (* pr p)))))))
(Python)
from sympy import nextprime, primepi, primorial
def a053669(n):
p = 2
while True:
if n%p: return p
else: p=nextprime(p)
def a257993(n): return primepi(a053669(n))
def a002110(n): return 1 if n<1 else primorial(n)
def a(n): return 0 if n==0 else n%a002110(a257993(n))
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 22 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Aug 22 2016
STATUS
approved