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”).

A086409
a[1]=1; a[n+1]=a[n]-1 if (prime[a[n]]+1)/2 is even, else a[n+1]=a[n]+4.
3
1, 5, 4, 3, 7, 11, 10, 14, 13, 17, 16, 20, 19, 18, 22, 21, 25, 29, 33, 37, 41, 40, 44, 48, 47, 46, 45, 49, 48, 47, 46, 45, 49, 48, 47, 46, 45, 49, 48, 47, 46, 45, 49, 48, 47, 46, 45, 49, 48, 47, 46
OFFSET
1,2
COMMENTS
There is a cycle starting with a(26)=46: ...46,45,49,48,47,46,...
LINKS
EXAMPLE
a(3)=4 because a(2)=5, prime[5]=11 (11+1)/2 is even and a(3)=a(2)-1
MATHEMATICA
b=1; Prepend[Table[b+=If[EvenQ[(Prime[b]+1)/2], -1, 4], {i, 52}], 1] (*A086409*)
NestList[If[EvenQ[(Prime[#]+1)/2], #-1, #+4]&, 1, 50] (* Harvey P. Dale, Mar 05 2020 *)
CROSSREFS
Sequence in context: A256099 A192918 A092156 * A202412 A194556 A154198
KEYWORD
easy,nonn
AUTHOR
Zak Seidov, Jul 18 2003
STATUS
approved