A276331 a(0) = 0 and for n >= 1, a(n) = n minus the largest term of A001563 that divides n.
0, 0, 1, 2, 0, 4, 5, 6, 4, 8, 9, 10, 8, 12, 13, 14, 12, 16, 0, 18, 16, 20, 21, 22, 20, 24, 25, 26, 24, 28, 29, 30, 28, 32, 33, 34, 18, 36, 37, 38, 36, 40, 41, 42, 40, 44, 45, 46, 44, 48, 49, 50, 48, 52, 36, 54, 52, 56, 57, 58, 56, 60, 61, 62, 60, 64, 65, 66, 64, 68, 69, 70, 54, 72, 73, 74, 72, 76, 77, 78, 76, 80, 81, 82, 80
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..4320
Programs
-
Mathematica
f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], (# #!) &[# - i]]], {i, 0, # - 1}] &@ NestWhile[# + 1 &, 0, (# #!) &[# + 1] <= n &]; Rest[a][[All, 1]]]; {0}~Join~Table[n - # #! &[Length@ TakeWhile[Reverse@ f@ n, # == 0 &] + 1], {n, 84}] (* Michael De Vlieger, Aug 31 2016 *)
-
Scheme
(define (A276331 n) (- n (A276330 n)))
Formula
a(n) = n - A276330(n).