OFFSET
1,2
LINKS
Jianglin Luo, Table of n, a(n) for n = 1..10080
David A. Corneth, PARI program
Jianglin Luo, Sagecell
EXAMPLE
a(6)=3 because 6 = 2*3 and 2=a(4) has appeared more recently than 3=a(3).
a(12)=2 because 12 = 2^2*3 and 3=a(9) has appeared more recently than 2=a(8).
a(30)=2 because 30 = 2*3*5 and 3=a(27) and 5=a(25) have appeared more recently than 2=a(24).
PROG
(SageMath)
def hpf_seq(top):
H=[0, 1, 2, 3]
for n in range(4, top):
prime_factors=[part[0] for part in list(factor(n))]
cursor=-1
while len(prime_factors)>1:
if H[cursor] in prime_factors:
prime_factors.remove(H[cursor])
cursor-=1
hpf=prime_factors[0]
H.append(hpf)
return H
(PARI) See PARI link \\ David A. Corneth, Sep 08 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jianglin Luo, Sep 08 2023
STATUS
approved