login
A326892
a(n) is the reversal of the next composite after a(n-1) if n is prime, otherwise it is the reversal of the next prime after a(n-1), starting with a(1) = 1.
3
1, 4, 6, 7, 8, 11, 21, 32, 73, 97, 89, 79, 8, 11, 31, 73, 47, 35, 63, 76, 97, 101, 201, 112, 311, 313, 713, 917, 819, 128, 921, 929, 739, 347, 943, 749, 57, 95, 79, 38, 93, 79, 8, 11, 31, 73, 47, 35, 73, 97, 101, 301, 203, 112, 311, 313, 713, 917, 819, 128
OFFSET
1,2
COMMENTS
Inspired by A326344.
The sequence is not periodic but bounded: a(n) <= 994 = a(1658) = a(2112) = a(2412) = a(3110) = ... .
LINKS
MAPLE
c:= n-> (k-> `if`(isprime(k), c(k), k))(n+1):
a:= proc(n) option remember; `if`(n=1, 1,
(s-> parse(cat(s[-i]$i=1..length(s))))(""||(
`if`(isprime(n), c(a(n-1)), nextprime(a(n-1))))))
end:
seq(a(n), n=1..100);
CROSSREFS
KEYWORD
nonn,look,base
AUTHOR
Alois P. Heinz, Sep 13 2019
STATUS
approved