login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A276094
a(n) = n modulo A002110(A257993(n)), a(0) = 0.
4
0, 1, 2, 1, 4, 1, 6, 1, 2, 1, 4, 1, 12, 1, 2, 1, 4, 1, 18, 1, 2, 1, 4, 1, 24, 1, 2, 1, 4, 1, 30, 1, 2, 1, 4, 1, 6, 1, 2, 1, 4, 1, 12, 1, 2, 1, 4, 1, 18, 1, 2, 1, 4, 1, 24, 1, 2, 1, 4, 1, 60, 1, 2, 1, 4, 1, 6, 1, 2, 1, 4, 1, 12, 1, 2, 1, 4, 1, 18, 1, 2, 1, 4, 1, 24, 1, 2, 1, 4, 1, 90, 1, 2, 1, 4, 1, 6, 1, 2, 1, 4, 1, 12, 1, 2, 1, 4, 1, 18, 1
OFFSET
0,3
LINKS
FORMULA
a(0) = 0, and for n >= 1, a(n) = n modulo A002110(A257993(n)).
or a(n) = A276088(n) * A002110(A276084(n)).
Other identities. For all n >= 0:
a(n) = n - A276093(n).
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)))))))
(define (A276094 n) (if (zero? n) n (modulo n (A002110 (A257993 n)))))
(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