login
A338668
a(n) is the rightmost prime number in prime tower factorization of n; a(1) = 1.
2
1, 2, 3, 2, 5, 3, 7, 3, 2, 5, 11, 3, 13, 7, 5, 2, 17, 2, 19, 5, 7, 11, 23, 3, 2, 13, 3, 7, 29, 5, 31, 5, 11, 17, 7, 2, 37, 19, 13, 5, 41, 7, 43, 11, 5, 23, 47, 3, 2, 2, 17, 13, 53, 3, 11, 7, 19, 29, 59, 5, 61, 31, 7, 3, 13, 11, 67, 17, 23, 7, 71, 2, 73, 37, 2
OFFSET
1,2
COMMENTS
The prime tower factorization of a number is defined in A182318.
FORMULA
a(n) <= n with equality iff n = 1 or n is a prime number.
a(n) = a(A053585(n)).
EXAMPLE
See Links section.
PROG
(PARI) a(n) = if (n==1, 1, my (f=factor(n), w=#f~); if (f[w, 2]==1, f[w, 1], a(f[w, 2])))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 23 2021
STATUS
approved