A208884 a(n) = (a(n-1) + n)/2^k where 2^k is the largest power of 2 dividing a(n-1) + n, for n>1 with a(1)=1.
1, 3, 3, 7, 3, 9, 1, 9, 9, 19, 15, 27, 5, 19, 17, 33, 25, 43, 31, 51, 9, 31, 27, 51, 19, 45, 9, 37, 33, 63, 47, 79, 7, 41, 19, 55, 23, 61, 25, 65, 53, 95, 69, 113, 79, 125, 43, 91, 35, 85, 17, 69, 61, 115, 85, 141, 99, 157, 27, 87, 37, 99, 81, 145, 105, 171
Offset: 1
Keywords
Examples
a(2) = 1 + 2 = 3; a(3) = (3 + 3)/2 = 3; a(4) = 3 + 4 = 7; a(5) = (7 + 5)/4 = 3; a(6) = 3 + 6 = 9; a(7) = (9 + 7)/16 = 1; ...
Links
- Paul D. Hanna, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, Colored scatterplot of the first 100000 terms (where the color is function of the parity of n)
Programs
-
Mathematica
a[1]=1; a[n_] := a[n] = #/2^IntegerExponent[#, 2] &@ (n + a[n-1]); Array[a, 70] (* Giovanni Resta, Jun 25 2020 *)
-
PARI
{a(n)=if(n==1, 1, (a(n-1)+n)/2^valuation(a(n-1)+n,2))}
-
PARI
{A=vector(1024); a(n)=A[n]=if(n==1, 1, (A[n-1]+n)/2^valuation(A[n-1]+n,2))} for(n=1,#A,print1(a(n),", "))
Comments