cp's OEIS Frontend

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.

Showing 1-4 of 4 results.

A001317 Sierpiński's triangle (Pascal's triangle mod 2) converted to decimal.

Original entry on oeis.org

1, 3, 5, 15, 17, 51, 85, 255, 257, 771, 1285, 3855, 4369, 13107, 21845, 65535, 65537, 196611, 327685, 983055, 1114129, 3342387, 5570645, 16711935, 16843009, 50529027, 84215045, 252645135, 286331153, 858993459, 1431655765, 4294967295, 4294967297, 12884901891, 21474836485, 64424509455, 73014444049, 219043332147, 365072220245, 1095216660735, 1103806595329, 3311419785987
Offset: 0

Views

Author

Keywords

Comments

The members are all palindromic in binary, i.e., a subset of A006995. - Ralf Stephan, Sep 28 2004
J. H. Conway writes (in Math Forum): at least the first 31 numbers give odd-sided constructible polygons. See also A047999. - M. Dauchez (mdzzdm(AT)yahoo.fr), Sep 19 2005 [This observation was also made in 1982 by N. L. White (see letter). - N. J. A. Sloane, Jun 15 2015]
Decimal number generated by the binary bits of the n-th generation of the Rule 60 elementary cellular automaton. Thus: 1; 0, 1, 1; 0, 0, 1, 0, 1; 0, 0, 0, 1, 1, 1, 1; 0, 0, 0, 0, 1, 0, 0, 0, 1; ... . - Eric W. Weisstein, Apr 08 2006
Limit_{n->oo} log(a(n))/n = log(2). - Bret Mulvey, May 17 2008
Equals row sums of triangle A166548; e.g., 17 = (2 + 4 + 6 + 4 + 1). - Gary W. Adamson, Oct 16 2009
Equals row sums of triangle A166555. - Gary W. Adamson, Oct 17 2009
For n >= 1, all terms are in A001969. - Vladimir Shevelev, Oct 25 2010
Let n,m >= 0 be such that no carries occur when adding them. Then a(n+m) = a(n)*a(m). - Vladimir Shevelev, Nov 28 2010
Let phi_a(n) be the number of a(k) <= a(n) and respectively prime to a(n) (i.e., totient function over {a(n)}). Then, for n >= 1, phi_a(n) = 2^v(n), where v(n) is the number of 0's in the binary representation of n. - Vladimir Shevelev, Nov 29 2010
Trisection of this sequence gives rows of A008287 mod 2 converted to decimal. See also A177897, A177960. - Vladimir Shevelev, Jan 02 2011
Converting the rows of the powers of the k-nomial (k = 2^e where e >= 1) term-wise to binary and reading the concatenation as binary number gives every (k-1)st term of this sequence. Similarly with powers p^k of any prime. It might be interesting to study how this fails for powers of composites. - Joerg Arndt, Jan 07 2011
This sequence appears in Pascal's triangle mod 2 in another way, too. If we write it as
1111111...
10101010...
11001100...
10001000...
we get (taking the period part in each row):
.(1) (base 2) = 1
.(10) = 2/3
.(1100) = 12/15 = 4/5
.(1000) = 8/15
The k-th row, treated as a binary fraction, seems to be equal to 2^k / a(k). - Katarzyna Matylla, Mar 12 2011
From Daniel Forgues, Jun 16-18 2011: (Start)
Since there are 5 known Fermat primes, there are 32 products of distinct Fermat primes (thus there are 31 constructible odd-sided polygons, since a polygon has at least 3 sides). a(0)=1 (empty product) and a(1) to a(31) are those 31 non-products of distinct Fermat primes.
It can be proved by induction that all terms of this sequence are products of distinct Fermat numbers (A000215):
a(0)=1 (empty product) are products of distinct Fermat numbers in { };
a(2^n+k) = a(k) * (2^(2^n)+1) = a(k) * F_n, n >= 0, 0 <= k <= 2^n - 1.
Thus for n >= 1, 0 <= k <= 2^n - 1, and
a(k) = Product_{i=0..n-1} F_i^(alpha_i), alpha_i in {0, 1},
this implies
a(2^n+k) = Product_{i=0..n-1} F_i^(alpha_i) * F_n, alpha_i in {0, 1}.
(Cf. OEIS Wiki links below.) (End)
The bits in the binary expansion of a(n) give the coefficients of the n-th power of polynomial (X+1) in ring GF(2)[X]. E.g., 3 ("11" in binary) stands for (X+1)^1, 5 ("101" in binary) stands for (X+1)^2 = (X^2 + 1), and so on. - Antti Karttunen, Feb 10 2016

Examples

			Given a(5)=51, a(6)=85 since a(5) XOR 2*a(5) = 51 XOR 102 = 85.
From _Daniel Forgues_, Jun 18 2011: (Start)
  a(0) = 1 (empty product);
  a(1) = 3 = 1 * F_0 = a(2^0+0) = a(0) * F_0;
  a(2) = 5 = 1 * F_1 = a(2^1+0) = a(0) * F_1;
  a(3) = 15 = 3 * 5 = F_0 * F_1 = a(2^1+1) = a(1) * F_1;
  a(4) = 17 = 1 * F_2 = a(2^2+0) = a(0) * F_2;
  a(5) = 51 = 3 * 17 = F_0 * F_2 = a(2^2+1) = a(1) * F_2;
  a(6) = 85 = 5 * 17 = F_1 * F_2 = a(2^2+2) = a(2) * F_2;
  a(7) = 255 = 3 * 5 * 17 = F_0 * F_1 * F_2 = a(2^2+3) = a(3) * F_2;
  ... (End)
		

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic sequences, Cambridge University Press, 2003, p. 113.
  • Henry Wadsworth Gould, Exponential Binomial Coefficient Series, Tech. Rep. 4, Math. Dept., West Virginia Univ., Morgantown, WV, Sept. 1961.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 136-137.

Crossrefs

Cf. A038183 (odd bisection, 1D Cellular Automata Rule 90).
Iterates of A048724 (starting from 1).
Row 3 of A048723.
Positions of records in A268389.
Positions of ones in A268669 and A268384 (characteristic function).
Not the same as A045544 nor as A053576.
Cf. A045544.

Programs

  • Haskell
    a001317 = foldr (\u v-> 2*v + u) 0 . map toInteger . a047999_row
    -- Reinhard Zumkeller, Nov 24 2012
    (Scheme, with memoization-macro definec, two variants)
    (definec (A001317 n) (if (zero? n) 1 (A048724 (A001317 (- n 1)))))
    (definec (A001317 n) (if (zero? n) 1 (A048720bi 3 (A001317 (- n 1))))) ;; Where A048720bi implements the dyadic function given in A048720.
    ;; Antti Karttunen, Feb 10 2016
    
  • Magma
    [&+[(Binomial(n, i) mod 2)*2^i: i in [0..n]]: n in [0..41]]; // Vincenzo Librandi, Feb 12 2016
    
  • Maple
    A001317 := proc(n) local k; add((binomial(n,k) mod 2)*2^k, k=0..n); end;
  • Mathematica
    a[n_] := Nest[ BitXor[#, BitShiftLeft[#, 1]] &, 1, n]; Array[a, 42, 0] (* Joel Madigan (dochoncho(AT)gmail.com), Dec 03 2007 *)
    NestList[BitXor[#,2#]&,1,50] (* Harvey P. Dale, Aug 02 2021 *)
  • PARI
    a(n)=sum(i=0,n,(binomial(n,i)%2)*2^i)
    
  • PARI
    a=1; for(n=0, 66, print1(a,", "); a=bitxor(a,a<<1) ); \\ Joerg Arndt, Mar 27 2013
    
  • PARI
    A001317(n,a=1)={for(k=1,n,a=bitxor(a,a<<1));a} \\ M. F. Hasler, Jun 06 2016
    
  • PARI
    a(n) = subst(lift(Mod(1+'x,2)^n), 'x, 2); \\ Gheorghe Coserea, Nov 09 2017
    
  • Python
    from sympy import binomial
    def a(n): return sum([(binomial(n, i)%2)*2**i for i in range(n + 1)]) # Indranil Ghosh, Apr 11 2017
    
  • Python
    def A001317(n): return int(''.join(str(int(not(~n&k))) for k in range(n+1)),2) # Chai Wah Wu, Feb 04 2022

Formula

a(n+1) = a(n) XOR 2*a(n), where XOR is binary exclusive OR operator. - Paul D. Hanna, Apr 27 2003
a(n) = Product_{e(j, n) = 1} (2^(2^j) + 1), where e(j, n) is the j-th least significant digit in the binary representation of n (Roberts: see Allouche & Shallit). - Benoit Cloitre, Jun 08 2004
a(2*n+1) = 3*a(2*n). Proof: Since a(n) = Product_{k in K} (1 + 2^(2^k)), where K is the set of integers such that n = Sum_{k in K} 2^k, clearly K(2*n+1) = K(2*n) union {0}, hence a(2*n+1) = (1+2^(2^0))*a(2*n) = 3*a(2*n). - Emmanuel Ferrand and Ralf Stephan, Sep 28 2004
a(32*n) = 3 ^ (32 * n * log(2) / log(3)) + 1. - Bret Mulvey, May 17 2008
For n >= 1, A000120(a(n)) = 2^A000120(n). - Vladimir Shevelev, Oct 25 2010
a(2^n) = A000215(n); a(2^n-1) = a(2^n)-2; for n >= 1, m >= 0,
a(2^(n-1)-1)*a(2^n*m + 2^(n-1)) = 3*a(2^(n-1))*a(2^n*m + 2^(n-1)-2). - Vladimir Shevelev, Nov 28 2010
Sum_{k>=0} 1/a(k) = Product_{n>=0} (1 + 1/F_n), where F_n=A000215(n);
Sum_{k>=0} (-1)^(m(k))/a(k) = 1/2, where {m(n)} is Thue-Morse sequence (A010060).
If F_n is defined by F_n(z) = z^(2^n) + 1 and a(n) by (1/2)*Sum_{i>=0}(1-(-1)^{binomial(n,i)})*z^i, then, for z > 1, the latter two identities hold as well with the replacement 1/2 in the right hand side of the 2nd one by 1-1/z. - Vladimir Shevelev, Nov 29 2010
G.f.: Product_{k>=0} ( 1 + z^(2^k) + (2*z)^(2^k) ). - conjectured by Shamil Shakirov, proved by Vladimir Shevelev
a(n) = A000225(n+1) - A219843(n). - Reinhard Zumkeller, Nov 30 2012
From Antti Karttunen, Feb 10 2016: (Start)
a(0) = 1, and for n > 1, a(n) = A048720(3, a(n-1)) = A048724(a(n-1)).
a(n) = A048723(3,n).
a(n) = A193231(A000079(n)).
For all n >= 0: A268389(a(n)) = n.
(End)

A008287 Triangle of quadrinomial coefficients, row n is the sequence of coefficients of (1 + x + x^2 + x^3)^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2, 1, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 1, 4, 10, 20, 31, 40, 44, 40, 31, 20, 10, 4, 1, 1, 5, 15, 35, 65, 101, 135, 155, 155, 135, 101, 65, 35, 15, 5, 1, 1, 6, 21, 56, 120, 216, 336, 456, 546, 580, 546, 456, 336, 216, 120, 56, 21, 6, 1
Offset: 0

Views

Author

Keywords

Comments

Coefficient of x^k in (1 + x + x^2 + x^3)^n is the number of distinct ways in which k unlabeled objects can be distributed in n labeled urns allowing at most 3 objects to fall in each urn. - N-E. Fahssi, Mar 16 2008
Rows of A008287 mod 2 converted to decimal equals A177882. - Vladimir Shevelev, Jan 02 2011
T(n,k) is the number of compositions of k into n parts p, each part 0<=p<=3. Adding 1 to each part, as a corollary, T(n,k) is the number of compositions of n+k into n parts p where 1<=p<=4. E.g., T(2,3)=4 since 3=0+3=3+0=1+2=2+1. In general, the entry (n,k) of the (l+1)-nomial triangle gives the number of compositions of k into n parts p, each part 0<=p<=l. - Steffen Eger, Jun 18 2011
Number of lattice paths from (0,0) to (n,k) using steps (1,0), (1,1), (1,2), (1,3). - Joerg Arndt, Jul 05 2011
T(n-1,k-1) is the number of 3-compositions of n with zeros having k parts; see Hopkins & Ouvry reference. - Brian Hopkins, Aug 16 2020
T(n,k) is the number of ways to obtain a sum of n+k when throwing a 4-sided die n times. Follows from the "T(n,k) is the number of compositions of n+k into n parts p where 1 <= p <= 4" comment above. - Feryal Alayont, Dec 30 2024

Examples

			Triangle begins
  1;
  1,1,1,1;
  1,2,3,4,3,2,1;
  1,3,6,10,12,12,10,6,3,1; ...
		

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 78.
  • D. C. Fielder and C. O. Alford, Pascal's triangle: top gun or just one of the gang?, in G E Bergum et al., eds., Applications of Fibonacci Numbers Vol. 4 1991 pp. 77-90 (Kluwer).

Crossrefs

Programs

  • Haskell
    a008287 n = a008287_list !! n
    a008287_list = concat $ iterate ([1,1,1,1] *) [1]
    instance Num a => Num [a] where
       fromInteger k = [fromInteger k]
       (p:ps) + (q:qs) = p + q : ps + qs
       ps + qs         = ps ++ qs
       (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
        *                = []
    -- Reinhard Zumkeller, Apr 02 2011
  • Maple
    #Define the r-nomial coefficients for r = 1, 2, 3, ...
    rnomial := (r,n,k) -> add((-1)^i*binomial(n,i)*binomial(n+k-1-r*i,n-1), i = 0..floor(k/r)):
    #Display the 4-nomials as a table
    r := 4:  rows := 10:
    for n from 0 to rows do
    seq(rnomial(r,n,k), k = 0..(r-1)*n)
    end do;
    # Peter Bala, Sep 07 2013
    # second Maple program:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))((1+x+x^2+x^3)^n):
    seq(T(n), n=0..10);  # Alois P. Heinz, Aug 17 2018
  • Mathematica
    Flatten[Table[CoefficientList[(1 + x + x^2 + x^3)^n, x], {n, 0, 10}]] (* T. D. Noe, Apr 04 2011 *)
    T[n_, k_] := Sum[Binomial[n, i] Binomial[n, k-2i], {i, 0, k/2}]; Table[T[n, k], {n, 0, 6}, {k, 0, 3n}] // Flatten (* Jean-François Alcover, Feb 02 2018 *)
  • Maxima
    quadrinomial(n,k):=coeff(expand((1+x+x^2+x^3)^n),x,k);
    create_list(quadrinomial(n,k),n,0,8,k,0,3*n); /* Emanuele Munarini, Mar 15 2011 */
    

Formula

n-th row is formed by expanding (1+x+x^2+x^3)^n.
From Vladimir Shevelev, Dec 15 2010: (Start)
T(n,0) = 1; T(n,3*n) = 1; T(n,k) = T(n,3*n-k);
T(n,k) = 0, iff k<0 or k>3*n; Sum{k=0..3*n} T(n,k) = 4^n; Sum{k=0..3*n}((-1)^k)*T(n,k)=0 for n > 0; [corrected by Werner Schulte, Sep 09 2015]
T(n,k) = Sum{i=0..floor(k/2)} C(n,i)*C(n,k-2*i);
T(n+1,k) = T(n,k-3)+T(n,k-2)+T(n,k-1)+T(n,k). (End)
T(n,k) = Sum_{i = 0..floor(k/4)} (-1)^i*C(n,i)*C(n+k-1-4*i,n-1) for n >= 0 and 0 <= k <= 3*n. - Peter Bala, Sep 07 2013
G.f.: 1/(1 - ( x + y*x + y^2*x +y^3*x )). - Geoffrey Critzer, Feb 05 2014
T(n,k) = Sum_{j=0..k} (-2)^j*binomial(n,j)*binomial(3*n-2*j,k-j) for n >= 0 and 0 <= k <= 3*n (conjectured). - Werner Schulte, Sep 09 2015

A177897 Triangle of octanomial coefficients read by rows: n-th row is obtained by expanding ((1+x)*(1+x^2)*(1+x^4))^n mod 2 and converting to decimal.

Original entry on oeis.org

1, 255, 21845, 3342387, 286331153, 64424509455, 5519032976645, 844437815230467, 72340172838076673, 18446744073709551615, 1567973246265311887445, 241781474574111093044019, 20552052528097949033496593, 4660480146812799619066433295, 396140812663555408357742346245, 61084913312720243968763869790979
Offset: 0

Views

Author

Vladimir Shevelev, Dec 15 2010

Keywords

Comments

A generalization: Denote {a_k(n)}_(n>=0) the sequence of triangle of 2^k-nomial coefficients [read by rows: n-th row is obtained by expanding ((1+x)*(1+x^2)*...*(1+x^(2^(k-1)))^n ] mod 2 converted to decimal. Then a_k(n)=A001317((2^k-1)*n). [Proof is based on the fact (following from the Lucas theorem for the binomial coefficients) that the k-th row of Pascal triangle contains odd coefficients only iff k is Mersenne number (k=2^m-1)].

Crossrefs

Programs

  • Mathematica
    a = Plus@@(x^Range[0, 7]); Table[FromDigits[Mod[CoefficientList[a^n, x], 2], 2], {n, 0, 15}]
  • PARI
    a(n) = subst(lift(Mod(1+'x, 2)^(7*n)), 'x, 2); \\ Michel Marcus, Oct 14 2024
  • Python
    def A177897(n): return sum((bool(~(m:=7*n)&m-k)^1)<Chai Wah Wu, May 03 2023
    

Formula

a(n) = A001317(7*n).

Extensions

More terms from Michel Marcus, Oct 14 2024

A177960 Numbers of the form A001317(t), excluding those at places of the form t=m*(2^k-1), m>=0, k>=2.

Original entry on oeis.org

3, 5, 17, 51, 257, 1285, 3855, 13107, 65537, 196611, 983055, 1114129, 5570645, 16711935, 50529027, 84215045, 858993459, 4294967297, 21474836485, 219043332147, 365072220245, 1103806595329, 3311419785987
Offset: 1

Views

Author

Vladimir Shevelev, Dec 24 2010

Keywords

Comments

m-nomial (m>=2) coefficients are coefficients of the polynomial (1+x+...+x^(m-1))^n (n>=0), see A007318 (m=2), A027907 (m=3), A008287 (m=4), A035343 (m=5) etc. For k>=1, consider the triangle of 2^k-nomial coefficients, each entry reduced mod 2, and convert each row of the reduced triangle to a single number by interpreting the sequence of bits as binary representation of a number. This defines sequences A001317 (k=1), A177882 (k=2), A177897 (k=3), etc. The current sequence lists terms of A001317 which are not derived from any of the sequences for k >=2, not from 4-nomial, not from 8-nomial, not from 16-nomial etc.
Conjecture: If for every m>=2, to consider triangle of m-nomial coefficients mod 2 converted to decimal, then the sequence lists terms of A001317 which are not in the union of other sequences for m=3 (A038184), 4 (A177882), 5, 6,...

Crossrefs

Formula

Denote by B(n) the number of terms of the sequence among the first n terms of A001317. Then lim_{n->infinity} B(n)/ = Product_{prime p>=2} (1 - 1/(2^p-1)) = A184085.
Showing 1-4 of 4 results.