A001317 Sierpiński's triangle (Pascal's triangle mod 2) converted to decimal.
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
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.
Links
- Amiram Eldar, Table of n, a(n) for n = 0..3321 (terms 0..300 from T. D. Noe, terms 301..1023 from Tilman Piesk)
- Gary W. Adamson, Letter to N. J. A. Sloane, Apr 29 1994, and MS "Algorithm for the Chinese Remainder Theorem".
- Gary W. Adamson and N. J. A. Sloane, Correspondence, May 1994, including Adamson's MSS "Algorithm for Generating nth Row of Pascal's Triangle, mod 2, from n", and "The Tower of Hanoi Wheel".
- Cristian Cobeli and Alexandru Zaharescu, Promenade around Pascal Triangle-Number Motives, Bull. Math. Soc. Sci. Math. Roumanie, Tome 56(104), No. 1 (2013), pp. 73-98; alternative link.
- Richard K. Guy, The Second Strong Law of Small Numbers, Math. Mag, Vol. 63, No. 1 (1990), pp. 3-20. [Annotated scanned copy]
- Richard K. Guy and N. J. A. Sloane, Correspondence, 1988.
- Denton Hewgill, A relationship between Pascal's triangle and Fermat numbers, Fib. Quart., Vol. 15, No. 2 (1977), pp. 183-184.
- A. J. Macfarlane, Generating functions for integer sequences defined by the evolution of cellular automata with even rule numbers, Fig. 4.
- Dr. Math, Regular polygon formulas.
- P. Mathonet, M. Rigo, M. Stipulanti and N. Zénaïdi, On digital sequences associated with Pascal's triangle, arXiv:2201.06636 [math.NT], 2022.
- OEIS Wiki, Constructible odd-sided polygons and Sierpinski's triangle.
- Vladimir Shevelev, On Stephan's conjectures concerning Pascal triangle modulo 2, J. Alg. Number Theory, Vol. 7, No. 1 (2012) pp. 11-29, preprint, arXiv:1011.6083 [math.NT], 2010-2012.
- John Frederick Sweeney, Clifford Clock and the Moolakaprithi Cube, 2014. See p. 26. - _N. J. A. Sloane_, Mar 20 2014
- Eric Weisstein's World of Mathematics, Rule 60 and Rule 102.
- Neil L. White, Letter to N. J. A. Sloane, Apr 15 1982.
- R. G. Wilson, V, Letter to N. J. A. Sloane, Aug. 1993.
- Index entries for sequences related to cellular automata
- Index entries for sequences operating on polynomials in ring GF(2)[X]
Crossrefs
Cf. A000079, A000215 (Fermat numbers), A047999, A048720, A054432, A173019, A177882, A177897, A177960, A193231, A230116, A247282, A249184, A268391.
Cf. A038183 (odd bisection, 1D Cellular Automata Rule 90).
Iterates of A048724 (starting from 1).
Row 3 of A048723.
Positions of records in A268389.
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
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
From Antti Karttunen, Feb 10 2016: (Start)
a(n) = A048723(3,n).
For all n >= 0: A268389(a(n)) = n.
(End)
Comments