login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A365521 a(1) = 1; for n > 1, a(n) is the prime factor of n that has not appeared for the longest time in {a(1),...,a(n-2),a(n-1)}. 1
1, 2, 3, 2, 5, 3, 7, 2, 3, 5, 11, 2, 13, 7, 3, 2, 17, 3, 19, 5, 7, 11, 23, 2, 5, 13, 3, 7, 29, 2, 31, 2, 11, 17, 5, 3, 37, 19, 13, 2, 41, 7, 43, 11, 5, 23, 47, 3, 7, 2, 17, 13, 53, 3, 11, 7, 19, 29, 59, 5, 61, 31, 3, 2, 13, 11, 67, 17, 23, 7, 71, 3, 73, 37, 5, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
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
Sequence in context: A342257 A286516 A273289 * A361725 A356840 A346152
KEYWORD
nonn,easy
AUTHOR
Jianglin Luo, Sep 08 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 23 14:20 EDT 2024. Contains 374549 sequences. (Running on oeis4.)