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-10 of 12 results. Next

A036952 Numbers whose binary expansion is a decimal prime.

Original entry on oeis.org

3, 5, 23, 47, 89, 101, 149, 157, 163, 173, 179, 185, 199, 229, 247, 253, 295, 313, 329, 331, 355, 367, 379, 383, 405, 425, 443, 453, 457, 471, 523, 533, 539, 565, 583, 587, 595, 631, 643, 647, 653, 659, 671, 675, 689, 703, 709, 755, 781, 785, 815, 841, 855
Offset: 1

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

A100051(f(a(n))) = 1 with f(x) = if x<2 then x else 10*f(floor(x/2)) + x mod 2. - Reinhard Zumkeller, Mar 31 2010
Primes in A007088. - N. J. A. Sloane, Feb 17 2023

Examples

			1 = 1_2 is not a prime.
2 = 10_2 is not OK because 10 = 2*5 is not a prime.
3 = 11_2 is OK because 11 is a prime.
4 = 100_2 is not OK because 100 = 4*25 is not a prime.
5 = 101_2 is OK because 101 is a prime.
7 = 111_2 is not OK because 111 = 3*37.
11 = 1011_2 is not OK because 1011 = 3*337.
313 = 100111001_2 is OK because 100111001 is prime.
		

Crossrefs

Programs

  • Maple
    A007088 := proc(n)
    dgs := convert(n,base,2) ;
    add(op(i,dgs)*10^(i-1),i=1..nops(dgs)) ;
    end proc:
    isA036952 := proc(n)
    isprime( A007088(n)) :
    end proc:
    A036952 := proc(n)
    if n =1 then
    3;
    else
    for a from procname(n-1)+1 do
    if isA036952(a) then
    return a ;
    end if;
    end do:
    end if;
    end proc:
    seq(A036952(n),n=1..80) ;
    # R. J. Mathar, Mar 12 2010
    A036952 := proc() if isprime(convert(n,binary)) then RETURN (n); fi; end: seq(A036952(), n=1..1000);  # K. D. Bajpai, Jul 04 2014
  • Mathematica
    f[n_,k_]:=FromDigits[IntegerDigits[n,k]];lst={};Do[If[PrimeQ[f[n,2]],AppendTo[lst,n]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Mar 12 2010 *)
    NestList[NestWhile[# + 2 &, #, ! PrimeQ[FromDigits[IntegerDigits[#2, 2]]] &, 2] &, 3, 52] (* Jan Mangaldan, Jul 02 2020 *)
  • PARI
    is(n)=my(v=binary(n));isprime(sum(i=1,#v,v[i]*10^(#v-i))) \\ Charles R Greathouse IV, Jun 28 2013

Extensions

Entry revised by R. J. Mathar and N. J. A. Sloane, Mar 12 2010

A099837 Expansion of (1 - x^2) / (1 + x + x^2) in powers of x.

Original entry on oeis.org

1, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1
Offset: 0

Views

Author

Paul Barry, Oct 27 2004

Keywords

Comments

A transform of (-1)^n.
Row sums of Riordan array ((1-x)/(1+x), x/(1+x)^2), A110162.
Let b(n) = Sum_{k=0..floor(n/2)} binomial(n-k,k)(-1)^(n-2k). Then a(n) = b(n) - b(n-2) = A049347(n) - A049347(n-2) (n > 0). The g.f. 1/(1+x) of (-1)^n is transformed to (1-x^2)/(1+x+x^2) under the mapping G(x)->((1-x^2)/(1+x^2))G(x/(1+x^2)). Partial sums of A099838.
A(n) = a(n+3) (or a(n) if a(0) is replaced by 2) appears, together with B(n) = A049347(n) in the formula 2*exp(2*Pi*n*i/3) = A(n) + B(n)*sqrt(3)*i, n >= 0, with i = sqrt(-1). See A164116 for the case N=5. - Wolfdieter Lang, Feb 27 2014

Examples

			G.f. = 1 - x - x^2 + 2*x^3 - x^4 - x^5 + 2*x^6 - x^7 - x^8 + 2*x^9 - x^10 + ...
		

Crossrefs

Programs

  • Maple
    A099837 := proc(n)
        option remember;
        if n <=2 then
            op(n+1,[1,-1,-1]) ;
        else
            -procname(n-1)-procname(n-2) ;
        end if;
    end proc:
    seq(A099837(n),n=0..80) ; # R. J. Mathar, Apr 26 2022
  • Mathematica
    a[0] = 1; a[n_] := Mod[n+2, 3] - Mod[n, 3]; A099837 = Table[a[n], {n, 0, 71}](* Jean-François Alcover, Feb 15 2012, after Michael Somos *)
    LinearRecurrence[{-1, -1}, {1, -1, -1}, 50] (* G. C. Greubel, Aug 08 2017 *)
  • Maxima
    A099837(n) := block(
            if n = 0 then 1 else [2,-1,-1][1+mod(n,3)]
    )$ /* R. J. Mathar, Mar 19 2012 */
    
  • PARI
    {a(n) = [2, -1, -1][n%3 + 1] - (n == 0)}; /* Michael Somos, Jan 19 2012 */
    
  • PARI
    Vec((1-x^2)/(1+x+x^2) + O(x^20)) \\ Felix Fröhlich, Aug 08 2017

Formula

G.f.: (1-x^2)/(1+x+x^2).
Euler transform of length 3 sequence [-1, -1, 1]. - Michael Somos, Mar 21 2011
Moebius transform is length 3 sequence [-1, 0, 3]. - Michael Somos, Mar 22 2011
a(n) = -b(n) where b(n) = A061347(n) is multiplicative with b(3^e) = -2 if e > 0, b(p^e) = 1 otherwise. - Michael Somos, Jan 19 2012
a(n) = a(-n). a(n) = c_3(n) if n > 1 where c_k(n) is Ramanujan's sum. - Michael Somos, Mar 21 2011
G.f.: (1 - x) * (1 - x^2) / (1 - x^3). a(n) = -a(n-1) - a(n-2) unless n = 0, 1, 2. - Michael Somos, Jan 19 2012
Dirichlet g.f.: Sum_{n>=1} a(n)/n^s = zeta(s)*(3^(1-s)-1). - R. J. Mathar, Apr 11 2011
a(n+3) = R(n,-1) for n >= 0, with the monic Chebyshev T-polynomials R with coefficient table A127672. - Wolfdieter Lang, Feb 27 2014
For n > 0, a(n) = 2*cos(n*Pi/3)*cos(n*Pi). - Wesley Ivan Hurt, Sep 25 2017
From Peter Bala, Apr 20 2024: (Start)
a(n) is equal to the n-th order Taylor polynomial (centered at 0) of 1/c(x)^(2*n) evaluated at x = 1, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the o.g.f. of the Catalan numbers A000108. Cf. A333093.
Row sums of the Riordan array A110162. (End)

A054535 Square array giving Ramanujan sum T(n,k) = c_n(k) = Sum_{m=1..n, (m,n)=1} exp(2 Pi i m k / n), read by antidiagonals upwards (n >= 1, k >= 1).

Original entry on oeis.org

1, -1, 1, -1, 1, 1, 0, -1, -1, 1, -1, -2, 2, 1, 1, 1, -1, 0, -1, -1, 1, -1, -1, -1, 2, -1, 1, 1, 0, -1, -2, -1, 0, 2, -1, 1, 0, 0, -1, -1, 4, -2, -1, 1, 1, 1, 0, 0, -1, 1, -1, 0, -1, -1, 1, -1, -1, -3, -4, -1, 2, -1, 2, 2, 1, 1, 0, -1, 1, 0, 0, -1, 1, -1, 0, -1, -1, 1, -1, 2, -1, -1, 0, 0, 6, -1, -1, -2, -1, 1, 1, 1, -1
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

Replace the first column in A077049 with any k-th column in A177121 to get a new array. Then the matrix inverse of the new array will have the k-th column of A054535 (this array) as its first column. - Mats Granvik, May 03 2010
We have T(n, k) = c_n(k) = Sum_{m=1..n, (m,n)=1} exp(2 Pi i m k / n) and
A054534(n, k) = c_k(n) = Sum_{m=1..k, (m,k)=1} exp(2 Pi i m n / k). That is, the current array is the transpose of array A054534. Dirichlet g.f.'s for these two arrays are given below by R. J. Mathar and Mats Granvik. - Petros Hadjicostas, Jul 27 2019

Examples

			Square array T(n,k) = c_n(k) (with rows n >= 1 and columns k >= 1) starts as follows:
   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
  -1,  1, -1,  1, -1,  1, -1,  1, -1,  1, -1,  1, -1, ...
  -1, -1,  2, -1, -1,  2, -1, -1,  2, -1, -1,  2, -1, ...
   0, -2,  0,  2,  0, -2,  0,  2,  0, -2,  0,  2,  0, ...
  -1, -1, -1, -1,  4, -1, -1, -1, -1,  4, -1, -1, -1, ...
   1, -1, -2, -1,  1,  2,  1, -1, -2, -1,  1,  2,  1, ...
  -1, -1, -1, -1, -1, -1,  6, -1, -1, -1, -1, -1, -1, ...
   0,  0,  0, -4,  0,  0,  0,  4,  0,  0,  0, -4,  0, ...
   ... [example edited by _Petros Hadjicostas_, Jul 27 2019]
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, page 160.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. Fifth ed., Oxford Science Publications, Clarendon Press, Oxford, 2003.
  • E. C. Titchmarsh and D. R. Heath-Brown, The theory of the Riemann zeta-function, 2nd ed., 1986.

Crossrefs

Transpose of array in A054534. Cf. A054532, A054533, A282634.
Cf. A086831=c_n(2) (2nd column), A085097=c_n(3) (3rd column), A085384=c_n(4) (4th column), A085639=c_n(5) (fifth column), A085906=c_n(6) (sixth column), A099837=c_3(n) (third row), A176742=c_4(n) (fourth row), A100051=c_6(n) (sixth row).

Programs

  • Maple
    with(numtheory): c:=(n,k)->phi(n)*mobius(n/gcd(n,k))/phi(n/gcd(n,k)): for n from 1 to 13 do seq(c(n+1-j,j),j=1..n) od; # gives the sequence in triangular form # Emeric Deutsch
    # to get the example above
    for n to 8 do
        seq(c(n, k), k = 1 .. 13);
    end do
    # Petros Hadjicostas, Jul 27 2019
  • Mathematica
    nmax = 14; t[n_, k_] := EulerPhi[n]*(MoebiusMu[n / GCD[n, k]] / EulerPhi[n / GCD[n, k]]); Flatten[ Table[t[n - k + 1, k], {n, 1, nmax}, {k, 1, n}]] (* Jean-François Alcover, Nov 10 2011, after Emeric Deutsch *)
    (* To get the example above in table format *)
    TableForm[Table[t[n, k], {n, 1, 8}, {k, 1, 13}]]
    (* Petros Hadjicostas, Jul 27 2019 *)

Formula

T(n,k) = c_n(k) = phi(n) * Moebius(n/gcd(n, k))/phi(n/gcd(n, k)). - Emeric Deutsch, Dec 23 2004 [The r.h.s. of this formula is known as the von Sterneck function, and it was introduced by him around 1900. - Petros Hadjicostas, Jul 20 2019]
Dirichlet series: Sum_{n>=1} c_n(k)/n^s = sigma_{1-s}(k)/zeta(s) where sigma is the sum-of-divisors function. Sum_{n>=1} c_k(n)/n^s = zeta(s)*Sum_{d|k} mu(k/d)*d^(1-s). [Hardy & Wright, Titchmarsh] - R. J. Mathar, Apr 01 2012 [We have sigma_{1-s}(k) = Sum_{d|k} d^{1-s} = Sum_{d|k} (k/d)^{1-s} = sigma_{s-1}(k) / k^{s-1}. - Petros Hadjicostas, Jul 27 2019]
From Mats Granvik, Oct 10 2016: (Start)
For n >= 1 and k >= 1 let
A(n,k) := if n mod k = 0 then k^r, otherwise 0;
B(n,k) := if n mod k = 0 then k/n^s, otherwise 0.
Then the Ramanujan's sum matrix equals
inverse(A).transpose(B) evaluated at s=0 and r=0.
Equals inverse(A051731).transpose(A127093).
Dirichlet g.f.: Sum_{n>=1} Sum_{k>=1} T(n,k)/(n^r*k^s) = zeta(s)*zeta(s + r - 1)/zeta(r) as in Wikipedia. (End)
T(n,k) = c_n(k) = Sum_{s | gcd(n,k)} s * Moebius(n/s). - Petros Hadjicostas, Jul 27 2019
Lambert series and a consequence: Sum_{n >= 1} c_n(k) * z^n / (1 - z^n) = Sum_{s|k} s * z^s and -Sum_{n >= 1} (c_n(k) / n) * log(1 - z^n) = Sum_{s|k} z^s for |z| < 1 (using the principal value of the logarithm). - Petros Hadjicostas, Aug 15 2019

Extensions

Name edited by Petros Hadjicostas, Jul 27 2019

A054534 Square array giving Ramanujan sum T(n,k) = c_k(n) = Sum_{m=1..k, (m,k)=1} exp(2 Pi i m n / k), read by antidiagonals upwards (n >= 1, k >= 1).

Original entry on oeis.org

1, 1, -1, 1, 1, -1, 1, -1, -1, 0, 1, 1, 2, -2, -1, 1, -1, -1, 0, -1, 1, 1, 1, -1, 2, -1, -1, -1, 1, -1, 2, 0, -1, -2, -1, 0, 1, 1, -1, -2, 4, -1, -1, 0, 0, 1, -1, -1, 0, -1, 1, -1, 0, 0, 1, 1, 1, 2, 2, -1, 2, -1, -4, -3, -1, -1, 1, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, 1, 1, -1, -2, -1, -1, 6, 0, 0, -1, -1, 2, -1, 1, -1, 2, 0, 4, -2, -1, 0, -3, -4, -1, 0, -1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

The Ramanujan sum is also known as the von Sterneck arithmetic function. Robert Daublebsky von Sterneck introduced it around 1900. - Petros Hadjicostas, Jul 20 2019
T(n, k) = c_k(n) is the sum of the n-th powers of the k-th primitive roots of unity. - Petros Hadjicostas, Jul 27 2019

Examples

			Array T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  1, -1, -1,  0, -1,  1, -1,  0,  0,  1, -1, ...
  1,  1, -1, -2, -1, -1, -1,  0,  0, -1, -1, ...
  1, -1,  2,  0, -1, -2, -1,  0, -3,  1, -1, ...
  1,  1, -1,  2, -1, -1, -1, -4,  0, -1, -1, ...
  1, -1, -1,  0,  4,  1, -1,  0,  0, -4, -1, ...
  1,  1,  2, -2, -1,  2, -1,  0, -3, -1, -1, ...
  1, -1, -1,  0, -1,  1,  6,  0,  0,  1, -1, ...
  ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, page 160.
  • H. Rademacher, Collected Papers of Hans Rademacher, vol. II, MIT Press, 1974, p. 435.
  • S. Ramanujan, On Certain Trigonometrical Sums and their Applications in the Theory of Numbers, pp. 179-199 of Collected Papers of Srinivasa Ramanujan, Ed. G. H. Hardy et al., AMS Chelsea Publishing 2000.
  • R. D. von Sterneck, Ein Analogon zur additiven Zahlentheorie, Sitzungsber. Acad. Wiss. Sapientiae Math.-Naturwiss. Kl. 111 (1902), 1567-1601 (Abt. IIa).

Crossrefs

Programs

  • Mathematica
    nmax = 14; mu[n_Integer] = MoebiusMu[n]; mu[] = 0; t[n, k_] := Total[ #*mu[k/#]& /@ Divisors[n]]; Flatten[ Table[ t[n-k+1, k], {n, 1, nmax}, {k, 1, n}]] (* Jean-François Alcover, Nov 14 2011, after Pari *)
    TableForm[Table[t[n, k], {n, 1, 7}, {k, 1, 11}]] (* to print a table like the one in the example - Petros Hadjicostas, Jul 27 2019 *)
  • PARI
    {T(n, k) = if( n<1 || k<1, 0, sumdiv( n, d, if( k%d==0, d * moebius(k / d))))} /* Michael Somos, Dec 05 2002 */
    
  • PARI
    {T(n, k) = if( n<1 || k<1, 0, polsym( polcyclo( k), n) [n + 1])} /* Michael Somos, Mar 21 2011 */
    
  • PARI
    /*To get an array like in the example above using Michael Somos' programs:*/
    {for (n=1, 20, for (k=1, 40, print1(T(n,k), ","); ); print(); ); } /* Petros Hadjicostas, Jul 27 2019 */

Formula

T(n, 1) = c_1(n) = 1. T(n, 2) = c_2(n) = A033999(n). T(n, 3) = c_3(n) = A099837(n) if n>1. T(n, 4) = c_4(n) = A176742(n) if n>1. T(n, 6) = c_6(n) = A100051(n) if n>1. - Michael Somos, Mar 21 2011
T(1, n) = c_n(1) = A008683(n). T(2, n) = c_n(2) = A086831(n). T(3, n) = c_n(3) = A085097(n). T(4, n) = c_n(4) = A085384(n). T(5, n) = c_n(5) = A085639(n). T(6, n) = c_n(6) = A085906(n). - Michael Somos, Mar 21 2011
T(n, n) = T(k * n, n) = A000010(n), T(n, 2*n) = -A062570(n). - Michael Somos, Mar 21 2011
Lambert series and a consequence: Sum_{k >= 1} c_k(n) * z^k / (1 - z^k) = Sum_{s|n} s * z^s and -Sum_{k >= 1} (c_k(n) / k) * log(1 - z^k) = Sum_{s|n} z^s for |z| < 1 (using the principal value of the logarithm). - Petros Hadjicostas, Aug 15 2019

A087204 Period 6: repeat [2, 1, -1, -2, -1, 1].

Original entry on oeis.org

2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1
Offset: 0

Views

Author

Nikolay V. Kosinov (kosinov(AT)unitron.com.ua), Oct 19 2003

Keywords

Comments

Satisfies (a(n))^2 = a(2n) + 2. Shifted differences of itself.
Moebius transform is length 6 sequence [1, -2, -3, 0, 0, 6]. - Michael Somos, Oct 22 2006
Twice the real part of x^n, where x is either of the primitive 6th roots of unity. For the root with positive imaginary part, the imaginary part of x^n is i*A128834(n)*sqrt(3)/2. - Peter Munn, Apr 25 2022

Examples

			a(2) = -1 = a(1) - a(0) = 1 - 2 = ((1+sqrt(-3))/2)^2 + ((1-sqrt(-3))/2)^2 = -1 = -2/4 + 2*sqrt(-3)/4 - 2/4 -2 sqrt(-3)/4 = -1.
G.f. = 2 + x - x^2 - 2*x^3 - x^4 + x^5 + 2*x^6 + x^7 - x^8 - 2*x^9 - x^10 + ...
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 176.
  • Paulo Ribenboim, My Numbers, My Friends: Popular Lectures on Number Theory, Springer-Verlag, NY, 2000, p. 6.

Crossrefs

Essentially the same as A057079 and A100051. Pairwise sums of A010892.
Cf. A128834.

Programs

  • Magma
    &cat[[2, 1, -1, -2, -1, 1]^^20]; // Wesley Ivan Hurt, Jun 19 2016
  • Maple
    A087204:=n->[2, 1, -1, -2, -1, 1][(n mod 6)+1]: seq(A087204(n), n=0..100); # Wesley Ivan Hurt, Jun 19 2016
  • Mathematica
    PadLeft[{}, 108, {2,1,-1,-2,-1,1}] (* Harvey P. Dale, Sep 11 2011 *)
    a[ n_] := {1, -1, -2, -1, 1, 2}[[Mod[n, 6, 1]]]; (* Michael Somos, Jan 29 2015 *)
    a[ n_] := 2 Re[ Exp[ Pi I n / 3]]; (* Michael Somos, Mar 29 2015 *)
  • PARI
    {a(n) = [2, 1, -1, -2, -1, 1][n%6 + 1]}; /* Michael Somos, Oct 22 2006 */
    
  • PARI
    A087204(n) = if(0==n, 2, my(f = factor(n)); prod(k=1, #f~, if(f[k, 1]<=3, 1-f[k, 1], 1))); \\ (After David W. Wilson's multiplicative formula) - Antti Karttunen, Apr 28 2022
    
  • Sage
    [lucas_number2(n,1,1) for n in range(0, 102)] # Zerinvary Lajos, Apr 30 2009
    

Formula

a(n) = a(n-1) - a(n-2), starting with a(0) = 2 and a(1) = 1.
G.f.: (2-x)/(1-x+x^2).
a(n) = Sum_{k>=0} (-1)^k*n/(n-k)*C(n-k, k).
a(n) = (1/2)*((-1)^floor(n/3) + 2*(-1)^floor((n+1)/3) + (-1)^floor((n+2)/3)).
Multiplicative with a(2^e) = -1, a(3^e) = -2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005
a(n) = a(-n) = -a(n-3) for all n in Z. - Michael Somos, Oct 22 2006
E.g.f.: 2*exp(x/2)*cos(sqrt(3)*x/2). - Sergei N. Gladkovskii, Aug 12 2012
a(n) = r^n + s^n, with r=(1+i*sqrt(3))/2 and s=(1-i*sqrt(3))/2 the roots of 1-x+x^2. - Ralf Stephan, Jul 19 2013
a(n) = 2*cos(n*Pi/3). - Wesley Ivan Hurt, Jun 19 2016
Dirichlet g.f.: zeta(s)*(1-2^(1-s)-3^(1-s)+6^(1-s)). - Amiram Eldar, Jan 01 2023

Extensions

Edited by Ralf Stephan, Feb 04 2005

A100063 A Chebyshev transform of Jacobsthal numbers.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1
Offset: 0

Views

Author

Paul Barry, Nov 02 2004

Keywords

Comments

A Chebyshev transform of A001045(n+1): if A(x) is the g.f. of a sequence, map it to ((1-x^2)/(1+x^2))*A(x/(1+x^2)).
Also decimal expansion of 1111/9990. - Elmo R. Oliveira, Feb 18 2024
Also partial quotients of the continued fraction expansion of sqrt(5/2). - Hugo Pfoertner, Jan 10 2025

Examples

			G.f. = 1 + x + x^2 + 2*x^3 + x^4 + x^5 + 2*x^6 + x^7 + x^8 + 2*x^9 + ... - _Michael Somos_, Feb 20 2024
		

Crossrefs

Programs

  • Mathematica
    PadRight[{1},120,{2,1,1}] (* or *) LinearRecurrence[{0,0,1},{1,1,1,2},120] (* Harvey P. Dale, Jul 08 2015 *)
    a[ n_] := If[n<1, Boole[n==0], {2, 1, 1}[[1+Mod[n, 3]]]]; (* Michael Somos, Feb 20 2024 *)
  • PARI
    my(x='x+O('x^50)); Vec((1+x)(1+x^2)/(1-x^3)) \\ G. C. Greubel, May 03 2017
    
  • PARI
    {a(n) = if(n<1, n==0, [2, 1, 1][n%3+1])}; /* Michael Somos, Feb 20 2024 */
    
  • PARI
    contfrac(sqrt(5/2),,80) \\ Hugo Pfoertner, Jan 10 2025

Formula

G.f.: (1+x)(1+x^2)/(1-x^3).
a(n) = n*Sum_{k=0..floor(n/2)} binomial(n-k, k)(-1)^k*A001045(n-2k+1)/(n-k).
Multiplicative with a(3^e) = 2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 11 2005
Dirichlet g.f.: zeta(s)*(1+1/3^s). Dirichlet convolution of A154272 and A000012. - R. J. Mathar, Feb 07 2011
a(n) = 2 if n == 0 (mod 3) and n > 0, and a(n) = 1 otherwise. - Amiram Eldar, Nov 01 2022
a(n) = gcd(Fibonacci(n), Lucas(n)) = gcd(A000045(n), A000032(n)), for n >= 1. - Amiram Eldar, Jul 10 2023

A132367 Period 6: repeat [1, 1, 2, -1, -1, -2].

Original entry on oeis.org

1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2, 1, 1, 2, -1, -1, -2
Offset: 0

Views

Author

Paul Curtz, Nov 09 2007

Keywords

Comments

Nonsimple continued fraction expansion of 1+1/sqrt(3) = 1 + A020760. - R. J. Mathar, Mar 08 2012

Crossrefs

Programs

Formula

a(n) = cos(Pi*n/3)/3+sqrt(3)*sin(Pi*n/3)+2*(-1)^n/3. - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, Jun 19 2016: (Start)
G.f.: (1+x+2*x^2)/(1+x^3).
a(n) + a(n-3) = 0 for n>2. (End)

A100050 A Chebyshev transform of n.

Original entry on oeis.org

0, 1, 2, 0, -4, -5, 0, 7, 8, 0, -10, -11, 0, 13, 14, 0, -16, -17, 0, 19, 20, 0, -22, -23, 0, 25, 26, 0, -28, -29, 0, 31, 32, 0, -34, -35, 0, 37, 38, 0, -40, -41, 0, 43, 44, 0, -46, -47, 0, 49, 50, 0, -52, -53, 0, 55, 56, 0, -58, -59, 0, 61, 62, 0, -64, -65, 0, 67, 68, 0, -70, -71, 0, 73, 74, 0, -76, -77, 0, 79, 80, 0, -82, -83, 0, 85, 86, 0
Offset: 0

Views

Author

Paul Barry, Oct 31 2004

Keywords

Comments

A Chebyshev transform of x/(1-x)^2: if A(x) is the g.f. of a sequence, map it to ((1-x^2)/(1+x^2))A(x/(1+x^2)).

Examples

			x + 2*x^2 - 4*x^4 - 5*x^5 + 7*x^7 + 8*x^8 - 10*x^10 - 11*x^11 + 13*x^13 + ...
		

Crossrefs

Cf. A165202 (partial sums).

Programs

  • Mathematica
    LinearRecurrence[{2, -3, 2, -1}, {0, 1, 2, 0},50] (* G. C. Greubel, Aug 08 2017 *)
  • PARI
    {a(n) = n * (-1)^(n\3) * sign( n%3)} /* Michael Somos, Mar 19 2011 */
    
  • PARI
    {a(n) = local(A, p, e); if( abs(n)<1, 0, A = factor(abs(n)); prod( k=1, matsize(A)[1], if( p=A[k,1], e=A[k,2]; if( p==2, -(-2)^e, (kronecker( -12, p) * p)^e))))} /* Michael Somos, Mar 19 2011 */
  • Sage
    [lucas_number1(n,2,1)*lucas_number1(n,1,1) for n in range(0,88)] # Zerinvary Lajos, Jul 06 2008
    

Formula

Euler transform of length 6 sequence [ 2, -3, -2, 0, 0, 2]. - Michael Somos, Mar 19 2011
a(n) is multiplicative with a(2^e) = -(-2)^e if e>0, a(3^e) = 0^e, a(p^e) = p^e if p == 1 (mod 6), a(p^e) = (-p)^e if p == 5 (mod 6). - Michael Somos, Mar 19 2011
G.f.: x*(1 - x^2)^3 *(1 - x^3)^2 / ((1 - x)^2 *(1 - x^6)^2) = x *(1 + x)^2 *(1 - x^2) / (1 + x^3)^2. - Michael Somos, Mar 19 2011
a(3*n) = 0, a(3*n + 1) = (-1)^n * (3*n + 1), a(3*n + 2) = (-1)^n * (3*n + 2). a(-n) = a(n). - Michael Somos, Mar 19 2011
G.f.: x(1-x^2)/(1-x+x^2)^2.
a(n) = 2*a(n-1) -3*a(n-2) +2*a(n-3) -a(n-4).
a(n) = n*Sum_{k=0..floor(n/2)} (-1)^k*binomial(n-k,k)*(n-2k)/(n-k).

A107751 a(n) = A107750(n+1) - A107750(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2
Offset: 0

Views

Author

Reinhard Zumkeller, May 23 2005

Keywords

Crossrefs

Programs

  • Mathematica
    A107751[ nmax_ ] := Length /@ Split[ (Total[ 1 - IntegerDigits[ #1, 2 ] ] &) /@ Range[ 0, nmax ] ]; A107751[ 200 ] (* Peter Pein (petsie(AT)dordos.net), Oct 12 2007 *)
  • PARI
    up_to = 65537;
    A107751list(up_to) = { my(v=vector(up_to)); v[1]=v[2]=v[3]=v[4]=1; for(n=5,up_to,v[n] = (0^(v[n-1]-1) + 0^(v[n-2]-1))); (v); };
    v107751 = A107751list(up_to);
    A107751(n) = if(!n,1,v107751[n]); \\ Antti Karttunen, Dec 23 2018

Formula

a(n) = if n<=4 then 1 else 0^(a(n-1)-1) + 0^(a(n-2)-1).

A122876 a(0)=1, a(1)=1, a(2)=2, a(n) = a(n-1) - a(n-2) for n>2.

Original entry on oeis.org

1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1, -2, -1
Offset: 0

Views

Author

Philippe Deléham, Oct 24 2006

Keywords

Comments

Essentially the same as A057079, A087204 and A100051.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,-1}, {1,1,2}, 50] (* G. C. Greubel, May 03 2017; corrected by Georg Fischer, Apr 02 2019 *)
    (* or *) CoefficientList[Series[(1 + 2*x^2)/(1 - x + x^2), {x,0,50}], x] (* G. C. Greubel, May 03 2017 *)
  • PARI
    my(x='x+O('x^50)); Vec((1+2*x^2)/(1-x+x^2)) \\ G. C. Greubel, May 03 2017

Formula

a(n) = Sum_{k=0..floor(n/2)} (-2)^k*A055830(n-k,k).
G.f.: (1+2*x^2)/(1-x+x^2).
Showing 1-10 of 12 results. Next