login
A331304
For n <= 4, a(n) = n, for n > 4, if n is prime, a(n) = 3 + 2*A000035(A000720(n)), otherwise a(n) = 3 + n - A000720(n).
4
1, 2, 3, 4, 5, 6, 3, 7, 8, 9, 5, 10, 3, 11, 12, 13, 5, 14, 3, 15, 16, 17, 5, 18, 19, 20, 21, 22, 3, 23, 5, 24, 25, 26, 27, 28, 3, 29, 30, 31, 5, 32, 3, 33, 34, 35, 5, 36, 37, 38, 39, 40, 3, 41, 42, 43, 44, 45, 5, 46, 3, 47, 48, 49, 50, 51, 5, 52, 53, 54, 3, 55, 5, 56, 57, 58, 59, 60, 3, 61, 62, 63, 5, 64, 65, 66, 67, 68, 3, 69, 70, 71, 72, 73, 74, 75, 5, 76, 77, 78, 3, 79, 5, 80, 81
OFFSET
1,2
COMMENTS
Restricted growth sequence transform of function f defined as: f(n) = A071986(n) when n is an odd prime, otherwise f(n) = -n.
For all i, j:
a(i) = a(j) => A305801(i) = A305801(j),
a(i) = a(j) => A329647(i) = A329647(j),
a(i) = a(j) => A329903(i) = A329903(j).
FORMULA
For n <= 4, a(n) = n, for n > 4, if n is prime, a(n) = 3 + 2*A000035(A000720(n)), otherwise a(n) = 3 + n - A000720(n).
PROG
(PARI) A331304(n) = if(n<=4, n, if(isprime(n), 3+2*(primepi(n)%2), 3+n-primepi(n)));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 18 2020
STATUS
approved