[go: up one dir, main page]

login
Search: a006921 -id:a006921
     Sort: relevance | references | number | modified | created      Format: long | short | data
Stern-Jacobsthal numbers.
+0
9
1, 1, 3, 1, 7, 5, 11, 1, 23, 21, 59, 17, 103, 69, 139, 1, 279, 277, 827, 273, 1895, 1349, 2955, 257, 5655, 5141, 14395, 4113, 24679, 16453, 32907, 1, 65815, 65813, 197435, 65809, 460647, 329029, 723851, 65793, 1512983, 1381397, 3881019, 1118225
OFFSET
0,3
COMMENTS
The Stern diatomic sequence A002487 could be called the Stern-Fibonacci sequence, since it is given by A002487(n) = Sum_{k=0..floor(n/2)} (binomial(n-k,k) mod 2), where F(n+1) = Sum_{k=0..floor(n/2)} binomial(n-k,k). Now a(n) = Sum_{k=0..floor(n/2)} (binomial(n-k,k) mod 2)*2^k, where J(n+1) = Sum_{k=0..floor(n/2)} binomial(n-k,k)*2^k, with J(n) = A001045(n), the Jacobsthal numbers. - Paul Barry, Sep 16 2015
These numbers seem to encode Stern (0, 1)-polynomials in their binary expansion. See Dilcher & Ericksen paper, especially Table 1 on page 79, page 5 in PDF. See A125184 (A260443) for another kind of Stern-polynomials, and also A177219 for a reference to maybe a third kind. - Antti Karttunen, Nov 01 2016
LINKS
K. Dilcher and L. Ericksen, Reducibility and irreducibility of Stern (0, 1)-polynomials, Communications in Mathematics, Volume 22/2014 , pp. 77-102.
FORMULA
a(n) = Sum_{k=0..floor(n/2)} (binomial(n-k, k) mod 2)*2^k.
a(2^n-1)=1, a(2*n) = 2*a(n-1) + a(n+1) = A099902(n); a(2*n+1) = A101625(n+1).
a(n) = Sum_{k=0..n} (binomial(k, n-k) mod 2)*2^(n-k). - Paul Barry, May 10 2005
a(n) = Sum_{k=0..n} A106344(n,k)*2^(n-k). - Philippe Deléham, Dec 18 2008
a(0)=1, a(1)=1, a(n) = a(n-1) XOR (a(n-2)*2), where XOR is the bitwise exclusive-OR operator. - Alex Ratushnyak, Apr 14 2012
PROG
(Python)
prpr = 1
prev = 1
print("1, 1", end=", ")
for i in range(99):
current = (prev)^(prpr*2)
print(current, end=", ")
prpr = prev
prev = current
# Alex Ratushnyak, Apr 14 2012
(Python)
def A101624(n): return sum(int(not k & ~(n-k))*2**k for k in range(n//2+1)) # Chai Wah Wu, Jun 20 2022
(Haskell)
a101624 = sum . zipWith (*) a000079_list . map (flip mod 2) . a011973_row
-- Reinhard Zumkeller, Jul 14 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Dec 10 2004
STATUS
approved
Lucas sequence U_n(x,1) over the field GF(2).
+0
8
0, 1, 2, 5, 8, 21, 34, 81, 128, 337, 546, 1301, 2056, 5381, 8706, 20737, 32768, 86273, 139778, 333061, 526344, 1377557, 2228770, 5308753, 8388736, 22085713, 35782690, 85262357, 134742024, 352649221, 570556418, 1359020033, 2147483648
OFFSET
0,3
COMMENTS
The Lucas sequence U_n(x,1) over the field GF(2)={0,1} is: 0, 1, x, x^2+1, x^3, x^4+x^2+1, x^5+x, ... Numerical values are obtained evaluating these 01-polynomials at x=2 over the integers.
The counterpart sequence is V_n(x,1) = x*U_n(x,1) that implies identities like U_{2n}(x,1) = x*U_n(x,1)^2. - Max Alekseyev, Nov 19 2009
LINKS
FORMULA
For n>1, a(n) = (2*a(n-1)) XOR a(n-2).
a(n) = A248663(A206296(n)). - Antti Karttunen, Dec 11 2015
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := a[n] = BitXor[2 a[n - 1], a[n - 2]]; Table[a@ n, {n, 0, 32}] (* Michael De Vlieger, Dec 11 2015 *)
PROG
(PARI) { a=0; b=1; for(n=1, 50, c=bitxor(2*b, a); a=b; b=c; print1(c, ", "); ) }
(Python)
def A168081(n): return sum(int(not r & ~(2*n-1-r))*2**(n-1-r) for r in range(n)) # Chai Wah Wu, Jun 20 2022
CROSSREFS
A bisection of A006921. Cf. A260022. - N. J. A. Sloane, Jul 14 2015
See also A257971, first differences of A006921. - Reinhard Zumkeller, Jul 14 2015
KEYWORD
nonn
AUTHOR
Max Alekseyev, Nov 18 2009
STATUS
approved
First differences of A006921.
+0
3
0, 2, -1, 5, -2, 8, -5, 21, -8, 34, -21, 81, -34, 128, -81, 337, -128, 546, -337, 1301, -546, 2056, -1301, 5381, -2056, 8706, -5381, 20737, -8706, 32768, -20737, 86273, -32768, 139778, -86273, 333061, -139778, 526344, -333061, 1377557, -526344, 2228770
OFFSET
0,2
LINKS
FORMULA
a(2*n) = - A168081(n), a(2*n+1) = A168081(n+2);
a(2*n+4) = - a(2*n+1).
PROG
(Haskell)
a257971 n = a257971_list !! n
a257971_list = zipWith (-) (tail a006921_list) a006921_list
(Python)
def A257971(n): return sum(int(not r & ~(n+2-r))*2**(n//2+1-r) for r in range(n//2+2)) if n & 1 else -sum(int(not r & ~(n-1-r))*2**(n//2-1-r) for r in range(n//2)) # Chai Wah Wu, Jun 20 2022
CROSSREFS
KEYWORD
sign
AUTHOR
Reinhard Zumkeller, Jul 14 2015
STATUS
approved
A bisection of A006921.
+0
3
1, 3, 7, 13, 29, 55, 115, 209, 465, 883, 1847, 3357, 7437, 14087, 29443, 53505, 119041, 226051, 472839, 859405, 1903901, 3606327, 7537523, 13697489, 30474449, 57868403, 121045047, 220004381, 487391245, 923205639, 1929576451, 3506503681, 7801470977, 14814478339, 30987976711, 56321966093
OFFSET
0,2
LINKS
FORMULA
a(n) = A006921(2*n).
PROG
(Haskell)
a260022 = a006921 . (* 2) -- Reinhard Zumkeller, Jul 14 2015
(Python)
def A260022(n): return sum(int(not r & ~(2*n-r))*2**(n-r) for r in range(n+1)) # Chai Wah Wu, Jun 20 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 14 2015
STATUS
approved

Search completed in 0.011 seconds