login
An "extremely strange sequence": a(n+1) = [ A*a(n)+B ]/p^r, where p^r is the highest power of p dividing [ A*a(n)+B ] and p=2, A=4.001, B=1.2.
3

%I #18 Dec 28 2023 18:50:58

%S 0,1,5,21,85,341,1365,2731,10927,5465,10933,1367,2735,10943,5473,

%T 10949,1369,2739,10959,5481,10965,1371,2743,10975,5489,10981,1373,

%U 2747,10991,5497,10997,1375,2751,11007,5505,11013,1377,2755,11023,5513,11029,1379,2759

%N An "extremely strange sequence": a(n+1) = [ A*a(n)+B ]/p^r, where p^r is the highest power of p dividing [ A*a(n)+B ] and p=2, A=4.001, B=1.2.

%H Alois P. Heinz, <a href="/A028948/b028948.txt">Table of n, a(n) for n = 0..3740</a>

%F a(n+1) = A000265(floor(A*a(n)+B)). - _M. F. Hasler_, Aug 07 2018

%o (PARI) vector(50,i,if(i>1,t=(t*4001+1200)\1000;t>>=valuation(t,2),t=0)) \\ _M. F. Hasler_, Aug 07 2018

%o (Python)

%o from itertools import islice

%o def A028948_gen(): # generator of terms

%o x = 0

%o while True:

%o yield x

%o x = (y:=(x*4001+1200)//1000)>>(~y&y-1).bit_length()

%o A028948_list = list(islice(A028948_gen(),30)) # _Chai Wah Wu_, Dec 28 2023

%Y Cf. A000265.

%K nonn,easy

%O 0,3

%A _Yasutoshi Kohmoto_

%E a(0)=0 inserted by _M. F. Hasler_, Aug 07 2018