login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A327464
a(1) = 1; thereafter, a(n) is the reversal of the next prime after a(n - 1) in base 5 if n is prime, and the reversal of the next composite after a(n - 1) in base 5 if n is composite.
3
1, 2, 3, 4, 1, 4, 1, 4, 6, 16, 13, 22, 19, 4, 6, 16, 13, 22, 19, 4, 6, 16, 13, 22, 24, 1, 4, 6, 11, 12, 17, 18, 4, 6, 16, 18, 23, 24, 1, 4, 1, 4, 1, 4, 6, 16, 13, 22, 24, 1, 4, 6, 11, 12, 22, 24, 1, 4, 1, 4, 1, 4, 6, 16, 18, 4, 1, 4, 6, 16, 13, 22, 19, 4, 6, 16, 18, 4, 1, 4, 6, 16, 13, 22, 24
OFFSET
1,2
COMMENTS
The sequence is written in base 10.
Conjecture: the maximal value is 107, first attained at n = 883.
LINKS
MAPLE
digrev:= proc(n) local L, i;
L:= convert(n, base, 5);
add(L[-i]*5^(i-1), i=1..nops(L))
end proc:
nextcomp:= proc(n) local m;
for m from n+1 do if not isprime(m) then return m fi od
end proc:
A[1]:= 1:
for n from 2 to 100 do
if isprime(n) then A[n]:= digrev(nextprime(A[n-1]))
else A[n]:= digrev(nextcomp(A[n-1]))
fi
od:
seq(A[i], i=1..100); # Robert Israel, Sep 28 2019
CROSSREFS
For bases 3,5,6,7,10 see A326894, A327464 = the present sequence, A327463, A327241, A326344.
Sequence in context: A280694 A270313 A343251 * A318308 A003324 A110630
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Sep 27 2019
STATUS
approved