login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #12 Jan 09 2024 12:09:23

%S 1,5,4,3,7,11,10,14,13,17,16,20,19,18,22,21,25,29,33,37,41,40,44,48,

%T 47,46,45,49,48,47,46,45,49,48,47,46,45,49,48,47,46,45,49,48,47,46,45,

%U 49,48,47,46

%N a[1]=1; a[n+1]=a[n]-1 if (prime[a[n]]+1)/2 is even, else a[n+1]=a[n]+4.

%C There is a cycle starting with a(26)=46: ...46,45,49,48,47,46,...

%H Harvey P. Dale, <a href="/A086409/b086409.txt">Table of n, a(n) for n = 1..1000</a>

%e a(3)=4 because a(2)=5, prime[5]=11 (11+1)/2 is even and a(3)=a(2)-1

%t b=1; Prepend[Table[b+=If[EvenQ[(Prime[b]+1)/2], -1, 4], {i, 52}], 1] (*A086409*)

%t NestList[If[EvenQ[(Prime[#]+1)/2],#-1,#+4]&,1,50] (* _Harvey P. Dale_, Mar 05 2020 *)

%Y Cf. A086407, A086408.

%K easy,nonn

%O 1,2

%A _Zak Seidov_, Jul 18 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 21 03:54 EDT 2024. Contains 373540 sequences. (Running on oeis4.)