This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A165783 #10 May 14 2015 21:28:49 %S A165783 2,3,6,4,9,15,18,5,12,27,8,15,30,27,42,6,15,17,54,16,30,21,17,32,31, %T A165783 10,78,28,27,87,90,7,18,99,33,49,12,29,45,56,81,123,10,39,15,16,13,50, %U A165783 72,45,150,74,16,159,54,50,42,63,15,33,165,26,150,8,21,195,26,53,102,207 %N A165783 a(n) = A002326(n-1) + A000120(A165781(n-1)). %C A165783 Given a shift register : r(k)=r(k-1)+ X if r(k-1) is not divisible Y, else r(k)=r(k-1)/Y. %C A165783 Gcd(r(0), X))=1, Gcd(X, Y)=1. %C A165783 Then the length of the period orbit of such a register is L + digitsum (r(L)*(Y^L-1)/ X). Digitsum(z)in base X. %C A165783 r(L) a point from period orbit, L minimal possible exponent such that (Y^L-1)/X)is a positive integer. %C A165783 Number of period orbits is the order of the cyclic group connected to the register. %C A165783 a(n) is the period length for Y=2, X=2*n-1, r(L)=1. [_Ctibor O. Zizka_, Nov 24 2009] %H A165783 Ivan Neretin, <a href="/A165783/b165783.txt">Table of n, a(n) for n = 1..10000</a> %F A165783 a(n) = L + digitsum((2^L -1)/(2*n-1)). Digitsum(z)in base 2. [_Ctibor O. Zizka_, Nov 24 2009] %e A165783 n=1, a(1)=1 + digitsum(1)= 2. %e A165783 n=2, a(2)=2 + digitsum(1)=3. %e A165783 n=3, a(3)= 4 + digitsum(3) = 6. %e A165783 n=4, a(4)= 3 + digitsum(1)=4. %e A165783 n=5, a(5)= 6 + digitsum(7)=9. [_Ctibor O. Zizka_, Nov 24 2009] %p A165783 A002326 := proc(n) if n = 0 then 1; else numtheory[order](2,2*n+1) ; end if ; end proc: %p A165783 A165781 := proc(n) (2^A002326(n)-1)/(2*n+1) ; end proc: %p A165783 read("transforms") ; A165783 := proc(n) A002326(n-1)+wt(A165781(n-1) ) ; end proc: %p A165783 seq(A165783(n),n=1..80) ; # _R. J. Mathar_, Nov 26 2009 %t A165783 Table[(b = MultiplicativeOrder[2, 2 n - 1]) + Plus @@ IntegerDigits[(2^b - 1)/(2 n - 1), 2], {n, 1, 70}] (* _Ivan Neretin_, May 09 2015 *) %o A165783 (PARI) hamming(n)=my(v=binary(n));sum(i=1,#v,v[i]) %o A165783 a(n)=my(x=2*n+1,m=znorder(Mod(2,x)));m+hamming((1<<m)\x) %Y A165783 Cf. A002326, A053446. %K A165783 easy,nonn %O A165783 1,1 %A A165783 _Ctibor O. Zizka_, Sep 26 2009 %E A165783 Program and extension by _Charles R Greathouse IV_, Nov 24 2009 %E A165783 Definition corrected and comments merged by _R. J. Mathar_, Nov 26 2009