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!)
A086762 A piecewise recurrence relation with a(2)=7 and for n>=2: if a(n) is prime, not 31, a(n+1) = A000265(3*a(n)+1); if a(n) is odd composite, not 1, a(n+1) = A000265(a(n)+1); if a(n) is even, a(n+1) = A000265(a(n)); if a(n) is 1 or 31, find the number S(n) of occurrences of 1 and 31 among a(2),a(3),...,a(n) and compute a(n+1) by the above rules as if a(n) were 2+S(n), unless 2+S(n)=31, in which case a(n+1)=47. 1

%I #6 Oct 09 2013 14:20:13

%S 7,11,17,13,5,1,5,1,1,1,3,5,1,11,17,13,5,1,1,5,1,5,1,17,13,5,1,3,5,1,

%T 5,1,7,11,17,13,5,1,1,1,13,5,1,9,5,1,29,11,17,13,5,1,5,1,11,17,13,5,1,

%U 11,17,13,5,1,35,9,5,1,3,5,1,13,5,1,13,5,1,7,11,17,13,5,1,7,11,17,13,5,1

%N A piecewise recurrence relation with a(2)=7 and for n>=2: if a(n) is prime, not 31, a(n+1) = A000265(3*a(n)+1); if a(n) is odd composite, not 1, a(n+1) = A000265(a(n)+1); if a(n) is even, a(n+1) = A000265(a(n)); if a(n) is 1 or 31, find the number S(n) of occurrences of 1 and 31 among a(2),a(3),...,a(n) and compute a(n+1) by the above rules as if a(n) were 2+S(n), unless 2+S(n)=31, in which case a(n+1)=47.

%C Note that if we treated 31 like the other primes, we would enter the infinite loop 31, 47, 71, 107, 161, 81, 41, 31. Are there any remaining infinite loops?

%o (PARI) pxp1(m) = { for(x=2,m, n=x; while(n > 1, if(isprime(n),n=n*3+1,if(n%2<>0,n++)); while(n%2==0,n/=2); print1(n","); if(n==1 || n==31,break); ) ) }

%Y Cf. A086763, A000265.

%K easy,nonn

%O 2,1

%A _Cino Hilliard_, Aug 02 2003

%E Edited by _Sam Alexander_, Jan 05 2005

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 April 16 01:40 EDT 2024. Contains 371696 sequences. (Running on oeis4.)