OFFSET
1,2
LINKS
Sebastian F. Orellana, Table of n, a(n) for n = 1..6999
FORMULA
a(n) = n mod (1 + A006530(n)).
EXAMPLE
a(15) = 15 mod (5+1) = 15 mod 6 = 3.
MAPLE
a:= n-> irem(n, max(numtheory[factorset](n))+1):
seq(a(n), n=1..100); # Alois P. Heinz, Feb 10 2023
MATHEMATICA
a[n_] := Mod[n, FactorInteger[n][[-1, 1]] + 1]; Array[a, 100] (* Amiram Eldar, Feb 10 2023 *)
PROG
(PARI) a(n) = if (n==1, 1, n % (vecmax(factor(n)[, 1])+1)); \\ Michel Marcus, Feb 10 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Sebastian F. Orellana, Feb 09 2023
STATUS
approved