

A086407


a[1]=1; a[n+1]=a[n]1 if mod[prime[a[n]],6]=5, else a[n+1]=a[n]+4.


2



1, 5, 4, 8, 12, 16, 15, 14, 18, 22, 26, 25, 29, 33, 32, 31, 35, 34, 38, 42, 46, 50, 54, 53, 57, 56, 55, 54, 53, 57, 56, 55, 54, 53, 57, 56, 55, 54, 53, 57, 56, 55, 54, 53, 57, 56, 55, 54, 53, 57, 56, 55, 54
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

There is a cycle ...54,53,57,56,55,54,...


LINKS



EXAMPLE

a(3)=4 because a(2)=5, prime[5]=11=1 (mod 6) and a(3)=a(2)1


MATHEMATICA

b=1; Prepend[Table[b+=If[Mod[Prime[b], 6]\[Equal]5, 1, 4], {i, 32}], 1]
nxt[a_]:=If[Mod[Prime[a], 6]==5, a1, a+4]; NestList[nxt, 1, 60] (* Harvey P. Dale, May 29 2013 *)


CROSSREFS



KEYWORD

easy,nonn


AUTHOR



STATUS

approved



