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-5 of 5 results.

A120880 G.f. satisfies: A(x) = A(x^3)*(1 + 2*x + x^2); thus a(n) = 2^A062756(n), where A062756(n) is the number of 1's in the ternary expansion of n.

Original entry on oeis.org

1, 2, 1, 2, 4, 2, 1, 2, 1, 2, 4, 2, 4, 8, 4, 2, 4, 2, 1, 2, 1, 2, 4, 2, 1, 2, 1, 2, 4, 2, 4, 8, 4, 2, 4, 2, 4, 8, 4, 8, 16, 8, 4, 8, 4, 2, 4, 2, 4, 8, 4, 2, 4, 2, 1, 2, 1, 2, 4, 2, 1, 2, 1, 2, 4, 2, 4, 8, 4, 2, 4, 2, 1, 2, 1, 2, 4, 2, 1, 2, 1, 2, 4, 2, 4, 8, 4, 2, 4, 2, 4, 8, 4, 8, 16, 8, 4, 8, 4, 2, 4, 2, 4, 8, 4
Offset: 0

Views

Author

Paul D. Hanna, Jul 11 2006

Keywords

Comments

More generally, if g.f. of {a(n)} satisfies: A(x) = A(x^3)*(1 + b*x + c*x^2), then a(n) = b^A062756(n)*c^A081603(n), where A062756(n) is the number of 1's and A081603(n) is the number of 2's, in the ternary expansion of n. This sequence is not the same as A059151.
a(n) is the number of entries in the n-th row of Pascal's triangle that are congruent to 1 mod 3 minus the number of entries that are congruent to 2 mod 3. - N. Sato, Jun 22 2007 (see Liu (1991))
This sequence pertains to genotype Punnett square mathematics. Start with X = 1. Each hybrid cross involves the equation X:2X:X. Therefore, the ratio in the first (mono) hybrid cross is X=1:2X=2(1) or 2:X=1; or 1:2:1. When you move up to the next hybridization level, replace the previous cross ratio with X. X now represents 3 numbers—1:2:1. Therefore, the ratio in the second (di) hybrid cross is X = (1:2:1):2X = [2(1):2(2):2(1)] or (2:4:2):X = (1:2:1). Put it together and you get 1:2:1:2:4:2:1:2:1. Each time you move up a hybridization level, replace the previous ratio with X, and use the same equation—X:2X:X to get its ratio. - John Michael Feuk, Dec 10 2011
Also number of ways to write n as sum of two nonnegative numbers having in ternary representation no 3; see also A205565. - Reinhard Zumkeller, Jan 28 2012

Examples

			Records are 2^n at positions: 0,1,4,13,40,121,...,(3^n-1)/2,... (n>=0).
A(x) = 1 + 2*x + x^2 + 2*x^3 + 4*x^4 + 2*x^5 + x^6 + 2*x^7 + x^8 +...
		

Crossrefs

Programs

  • Haskell
    a120880 n = sum $ map (a039966 . (n -)) $ takeWhile (<= n) a005836_list
    -- Reinhard Zumkeller, Jan 28 2012
  • Mathematica
    Nest[ Join[#, 2 #, #] &, {1}, 5] (* Robert G. Wilson v, Jul 27 2014 *)
  • PARI
    a(n)=if(n==0,1,a(n\3)*2^((n%3)%2))
    

Formula

a((3^n+1)/2) = 2^n; a(n) = a(floor(n/3))*2^[[n (mod 3)] (mod 2)], with a(0)=1.
G.f.: A(x) = prod_{n>=0} (1 + x^(3^n))^2.
Self-convolution of A039966.
Row sums of triangle A117947(n,k) = balanced ternary of C(n,k) mod 3.

A117939 Triangle related to powers of 3 partitions of n.

Original entry on oeis.org

1, 2, 1, 1, -2, 1, 2, 0, 0, 1, 4, 2, 0, 2, 1, 2, -4, 2, 1, -2, 1, 1, 0, 0, -2, 0, 0, 1, 2, 1, 0, -4, -2, 0, 2, 1, 1, -2, 1, -2, 4, -2, 1, -2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 2, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, -4, 2, 0, 0, 0, 0, 0, 0, 1, -2, 1, 4, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 1, 8, 4, 0, 4, 2, 0, 0, 0, 0, 4, 2, 0, 2, 1
Offset: 0

Views

Author

Paul Barry, Apr 05 2006

Keywords

Examples

			Triangle begins
  1;
  2,  1;
  1, -2, 1;
  2,  0, 0,  1;
  4,  2, 0,  2,  1;
  2, -4, 2,  1, -2,  1;
  1,  0, 0, -2,  0,  0, 1;
  2,  1, 0, -4, -2,  0, 2,  1;
  1, -2, 1, -2,  4, -2, 1, -2, 1;
		

Crossrefs

Cf. A120854 (matrix log), A117941 (inverse), A117947 (matrix square-root).

Programs

  • Mathematica
    T[n_, k_]:= Sum[JacobiSymbol[Binomial[n, j], 3]*JacobiSymbol[Binomial[n-j, k], 3], {j, 0, n}]; Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 29 2021 *)
  • PARI
    T(n,k)=(matrix(n+1,n+1,r,c,(binomial(r-1,c-1)+1)%3-1)^2)[n+1,k+1] \\ Paul D. Hanna, Jul 08 2006
    
  • Sage
    def A117939(n, k): return sum(jacobi_symbol(binomial(n, j), 3)*jacobi_symbol(binomial(n-j, k), 3) for j in (0..n))
    flatten([[A117939(n, k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Oct 29 2021

Formula

Triangle T(n,k) = Sum_{j=0..n} L(C(n,j)/3)*L(C(n-j,k)/3) where L(j/p) is the Legendre symbol of j and p.
T(n, k) mod 2 = A117944(n,k).
T(n, 0) = A059151(n).
T(n, 1) = A117946(n).
Sum_{k=0..n} T(n, k) = A117940(n).
Matrix square of triangle A117947. Matrix log is the integer triangle A120854. - Paul D. Hanna, Jul 08 2006

A117963 Antidiagonal sums of a Legendre-binomial triangle for p = 3.

Original entry on oeis.org

1, 1, 2, 0, 2, 2, 1, 3, 4, -2, 2, 0, 2, 2, 4, 0, 4, 4, -1, 3, 2, 2, 4, 6, 1, 7, 8, -6, 2, -4, 4, 0, 4, -2, 2, 0, 2, 2, 4, 0, 4, 4, 2, 6, 8, -4, 4, 0, 4, 4, 8, 0, 8, 8, -5, 3, -2, 4, 2, 6, -1, 5, 4, 0, 4, 4, 2, 6, 8, 2, 10, 12, -5, 7, 2, 6, 8, 14, 1, 15, 16, -14, 2, -12, 8, -4, 4, -6, -2, -8, 8, 0, 8, -4, 4, 0, 4, 4, 8, -6, 2
Offset: 0

Views

Author

Paul Barry, Apr 05 2006

Keywords

Comments

Diagonal sums of A117947.

Examples

			The triangle mentioned in the name starts:
{1},
{1, 1},
{1,-1, 1},
{1, 0, 0, 1},
{1, 1, 0, 1, 1},
{1,-1, 1, 1,-1, 1},
{1, 0, 0,-1, 0, 0, 1}.
		

Crossrefs

Cf. A117947, A117964 [= a(n) mod 2].

Programs

  • Mathematica
    a[n_] := Sum[JacobiSymbol[Binomial[n - k, k], 3], {k, 0, n/2}];
    a /@ Range[0, 100] (* Jean-François Alcover, Oct 14 2019 *)
  • PARI
    {a(n)=local(A=1+x+x*O(x^n)); for(i=1,#binary(n), A=subst(A,x,x^3+x*O(x^n)) *(1-4*x^3-x^6)/(1-x-x^2+x*O(x^n))); polcoeff(A,n,x)} \\ Paul D. Hanna, Jul 11 2006
    
  • PARI
    A117963list(upto_n) = { my(A=1+x+x*O(x^upto_n)); for(i=1, #binary(upto_n), print1(i,", "); A=subst(A, x, x^3+x*O(x^upto_n)) *(1-4*x^3-x^6)/(1-x-x^2+x*O(x^upto_n))); print(); vector(upto_n,n,polcoeff(A,n-1)); }; \\ Antti Karttunen, Jan 01 2023, after Paul D. Hanna's program above.
    
  • PARI
    A117963(n) = sum(k=0,n\2,kronecker(binomial(n-k,k),3)); \\ Antti Karttunen, Jan 01 2023

Formula

a(n) = a(3n+2)/a(2).
a(n) = Sum_{k=0..floor(n/2)} L(C(n-k,k)/3) where L(j/p) is the Legendre symbol of j and p.
From Paul D. Hanna, Jul 11 2006: (Start)
G.f. satisfies: A(x) = A(x^3)*(1 - 4*x^3 - x^6)/(1 - x - x^2).
a(n) == Fibonacci(n+1) (mod 3);
a(n) == a(n-1) + a(n-2) (mod 3). (End)

A120854 Matrix log of A117939, read by rows, consisting only of 0's, 3's and signed 2's.

Original entry on oeis.org

0, 2, 0, 3, -2, 0, 2, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 3, -2, 0, 3, 0, 0, -2, 0, 0, 0, 0, 3, 0, 0, -2, 0, 2, 0, 0, 0, 3, 0, 0, -2, 3, -2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 3, -2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Paul D. Hanna, Jul 08 2006

Keywords

Comments

The number of nonzero elements in row n equals A053735(n), the sum of ternary digits of n. Row sums are A120855(n) = 2*A062756 + A081603(n), where A062756(n) = number of 1's in ternary expansion of n and A081603(n) = number of 2's in ternary expansion of n. Triangle A117939 is related to partitions of n into powers of 3 and is the matrix square of A117947, where A117947(n,k) = balanced ternary digits of C(n,k) mod 3, also A117947(n,k) = L(C(n,k)/3) where L(j/p) is the Legendre symbol of j and p.

Examples

			Triangle begins:
0;
2, 0;
3,-2, 0;
2, 0, 0, 0;
0, 2, 0, 2, 0;
0, 0, 2, 3,-2, 0;
3, 0, 0,-2, 0, 0, 0;
0, 3, 0, 0,-2, 0, 2, 0;
0, 0, 3, 0, 0,-2, 3,-2, 0;
2, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
Matrix exponentiation gives A117939:
1;
2, 1;
1,-2, 1;
2, 0, 0, 1;
4, 2, 0, 2, 1;
2,-4, 2, 1,-2, 1;
1, 0, 0,-2, 0, 0, 1;
2, 1, 0,-4,-2, 0, 2, 1;
1,-2, 1,-2, 4,-2, 1,-2, 1; ...
and A117939 is the matrix square of A117947:
1;
1, 1;
1,-1, 1;
1, 0, 0, 1;
1, 1, 0, 1, 1;
1,-1, 1, 1,-1, 1;
1, 0, 0,-1, 0, 0, 1;
1, 1, 0,-1,-1, 0, 1, 1;
1,-1, 1,-1, 1,-1, 1,-1, 1; ...
		

Crossrefs

Programs

  • PARI
    /* Generated as the Matrix LOG of A117939: */ T(n,k)=local(M=matrix(n+1,n+1,r,c,(binomial(r-1,c-1)+1)%3-1)^2, L=sum(i=1,#M,-(M^0-M)^i/i));return(L[n+1,k+1])
    
  • PARI
    /* Generated as the Ternary Fractal: */ T(n,k)=local(r=n,c=k,s=floor(log(n+1)/log(3))+1,u=vector(s),v=vector(s),d,e); if(n<=k,0,if(n<3&k<3,[0,0,0;2,0,0;3,-2,0][n+1,k+1], for(i=1,#u,u[i]=r%3;r=r\3);for(i=1,#v,v[i]=c%3;c=c\3); d=0;for(i=1,#v,if(u[i]!=v[i],d+=1;e=i));if(d==1,T(u[e],v[e]),0)))

Formula

Ternary fractal, T(3*n,3*k) = T(n,k), defined by: T(n,k) = 0 if n<=k or when more than 1 digit differs between the ternary expansions of n and k; else T(n,k) = T(m,j) where the only ternary digits of n, k, that differ are m, j, respectively and T(1,0)=2, T(2,1)=-2, T(2,0)=3.

A120855 Row sums of triangle A120854, which is the matrix log of triangle A117939.

Original entry on oeis.org

0, 2, 1, 2, 4, 3, 1, 3, 2, 2, 4, 3, 4, 6, 5, 3, 5, 4, 1, 3, 2, 3, 5, 4, 2, 4, 3, 2, 4, 3, 4, 6, 5, 3, 5, 4, 4, 6, 5, 6, 8, 7, 5, 7, 6, 3, 5, 4, 5, 7, 6, 4, 6, 5, 1, 3, 2, 3, 5, 4, 2, 4, 3, 3, 5, 4, 5, 7, 6, 4, 6, 5, 2, 4, 3, 4, 6, 5, 3, 5, 4, 2, 4, 3, 4, 6, 5, 3, 5, 4, 4, 6, 5, 6, 8, 7, 5, 7, 6, 3, 5, 4, 5, 7, 6
Offset: 0

Views

Author

Paul D. Hanna, Jul 08 2006

Keywords

Comments

Triangle A117939 is related to powers of 3 partitions of n and is the matrix square of A117947(n,k) = balanced ternary digits of C(n,k) mod 3, also A117947(n,k) = L(C(n,k)/3) where L(j/p) is the Legendre symbol of j and p.

Crossrefs

Programs

  • Mathematica
    f[n_] := DigitCount[n, 3] /. {a_, b_, c_} -> 2a + b + 0c; Array[f, 105, 0] (* Robert G. Wilson v, Jul 31 2012 *)
  • PARI
    {a(n)=local(M=matrix(n+1,n+1,r,c,(binomial(r-1,c-1)+1)%3-1)^2, L=sum(i=1,#M,-(M^0-M)^i/i));return(sum(k=0,n,L[n+1,k+1]))}

Formula

a(n) = 2*A062756 + A081603(n), where A062756(n) = number of 1's in ternary expansion of n and A081603(n) = number of 2's in ternary expansion of n.
Showing 1-5 of 5 results.