OFFSET
1,3
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..8192
FORMULA
a(1) = 1, a(2n) = n, a(2n+1) = A064989(2n+1).
Other identities. For all n >= 1:
a(2n-1) = A064216(n).
Above means: if n is odd, A001222(a(n)) = A001222(n) and if n is even, A001222(a(n)) = A001222(n) - 1.
Sum_{k=1..n} a(k) ~ c * n^2, where c = 1/8 + (1/2) * Product_{p prime > 2} ((p^2-p)/(p^2-q(p))) = 0.2905279467..., where q(p) = prevprime(p) (A151799). - Amiram Eldar, Jan 21 2023
MATHEMATICA
Table[Which[n == 1, 1, EvenQ@ n, n/2, True, Times @@ Power[
Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n], {n, 81}] (* Michael De Vlieger, Sep 16 2017 *)
PROG
(Python)
from sympy import factorint, prevprime
from operator import mul
def a064989(n):
f = factorint(n)
return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
def a(n): return 1 if n==1 else n//2 if n%2==0 else a064989(n)
print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Sep 15 2017
(PARI) a064989(n) = factorback(Mat(apply(t->[max(precprime(t[1]-1), 1), t[2]], Vec(factor(n)~))~)); \\ A064989
a(n) = if (n==1, 1, if (n%2, a064989(n), n/2)); \\ Michel Marcus, Oct 13 2021
CROSSREFS
A252464 gives the number of iterations needed to reach 1 from n.
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, Dec 20 2014
STATUS
approved