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!)
A102421 To get a(n), start with 2n+1, multiply by 3 and add 1 and divide out any power of 2; then multiply by 3 and subtract 1 and divide out any power of 2. 4

%I #31 Dec 04 2020 16:49:47

%S 1,7,1,1,5,25,7,17,19,43,1,13,7,61,1,35,37,79,5,11,23,97,25,53,55,115,

%T 7,31,1,133,17,71,73,151,19,5,41,169,43,89,91,187,1,49,25,205,13,107,

%U 109,223,7,29,59,241,61,125,127,259,1,67,17,277,35,143,145,295,37,19,77,313

%N To get a(n), start with 2n+1, multiply by 3 and add 1 and divide out any power of 2; then multiply by 3 and subtract 1 and divide out any power of 2.

%C "Start with 2n+1, multiply by 3 and add 1 and divide out any power of 2;" is "equivalent to Start with 3n+2, divide out any power of 2;" - _David A. Corneth_, Aug 22 2020

%H David A. Corneth, <a href="/A102421/b102421.txt">Table of n, a(n) for n = 0..9999</a>

%F a(n) = A337349(2*n+1). - _R. J. Mathar_, Aug 24 2020

%e n=1, 2n+1 = 3 -> 10 -> 5; 5 -> 14 ->7 = a(1).

%e n=17, 2*n+1 = 35 -> 106 ->53; 53 -> 158 -> 79 = a(17).

%p A102421 :=proc(n) local j; j:=3*n+1; while j mod 2 = 0 do j:=j/2; od: j:=3*j-1; while j mod 2 = 0 do j:=j/2; od: j; end proc;

%t nextx[x_Integer] := Block[{ a = x}, a = 3a + 1; While[EvenQ@a, a /= 2]; a = 3a - 1; While[EvenQ@a, a /= 2]; a]; Table[ nextx[2n + 1], {n, 0, 69}] (* _Robert G. Wilson v_ Sep 20 2006 *)

%o (PARI) a(n) = {n = 3*n + 2; n>>=valuation(n, 2); n = 3*n - 1; n >> valuation(n, 2)} \\ _David A. Corneth_, Aug 22 2020

%Y Cf. A000265, A102423.

%K nonn

%O 0,2

%A _N. J. A. Sloane_, based on email from Dan Asimov (dasimov(AT)earthlink.net), Sep 15 2006

%E Moved comments to A337349. - _R. J. Mathar_, Aug 24 2020

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 08:27 EDT 2024. Contains 371698 sequences. (Running on oeis4.)