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.

A001610 a(n) = a(n-1) + a(n-2) + 1, with a(0) = 0 and a(1) = 2.

Original entry on oeis.org

0, 2, 3, 6, 10, 17, 28, 46, 75, 122, 198, 321, 520, 842, 1363, 2206, 3570, 5777, 9348, 15126, 24475, 39602, 64078, 103681, 167760, 271442, 439203, 710646, 1149850, 1860497, 3010348, 4870846, 7881195, 12752042, 20633238, 33385281, 54018520
Offset: 0

Views

Author

Keywords

Comments

For prime p, p divides a(p-1). - T. D. Noe, Apr 11 2009 [This result follows immediately from the fact that A032190(n) = (1/n)*Sum_{d|n} a(d-1)*phi(n/d). - Petros Hadjicostas, Sep 11 2017]
Generalization. If a(0,x)=0, a(1,x)=2 and, for n>=2, a(n,x)=a(n-1,x)+x*a(n-2,x)+1, then we obtain a sequence of polynomials Q_n(x)=a(n,x) of degree floor((n-1)/2), such that p is prime iff all coefficients of Q_(p-1)(x) are multiple of p (sf. A174625). Thus a(n) is the sum of coefficients of Q_(n-1)(x). - Vladimir Shevelev, Apr 23 2010
Odd composite numbers n such that n divides a(n-1) are in A005845. - Zak Seidov, May 04 2010; comment edited by N. J. A. Sloane, Aug 10 2010
a(n) is the number of ways to modify a circular arrangement of n objects by swapping one or more adjacent pairs. E.g., for 1234, new arrangements are 2134, 2143, 1324, 4321, 1243, 4231 (taking 4 and 1 to be adjacent) and a(4) = 6. - Toby Gottfried, Aug 21 2011
For n>2, a(n) equals the number of Markov equivalence classes with skeleton the cycle on n+1 nodes. See Theorem 2.1 in the article by A. Radhakrishnan et al. below. - Liam Solus, Aug 23 2018
From Gus Wiseman, Feb 12 2019: (Start)
For n > 0, also the number of nonempty subsets of {1, ..., n + 1} containing no two cyclically successive elements (cyclically successive means 1 succeeds n + 1). For example, the a(5) = 17 stable subsets are:
{1}, {2}, {3}, {4}, {5}, {6},
{1,3}, {1,4}, {1,5}, {2,4}, {2,5}, {2,6}, {3,5}, {3,6}, {4,6},
{1,3,5}, {2,4,6}.
(End)
Also the rank of the n-Lucas cube graph. - Eric W. Weisstein, Aug 01 2023

References

  • 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).

Crossrefs

Programs

  • GAP
    List([0..40], n-> Lucas(1,-1,n+1)[2] -1); # G. C. Greubel, Jul 12 2019
  • Haskell
    a001610 n = a001610_list !! n
    a001610_list =
       0 : 2 : map (+ 1) (zipWith (+) a001610_list (tail a001610_list))
    -- Reinhard Zumkeller, Aug 21 2011
    
  • Magma
    I:=[0,2]; [n le 2 select I[n] else Self(n-1)+Self(n-2)+1: n in [1..40]]; // Vincenzo Librandi, Mar 20 2015
    
  • Magma
    [Lucas(n+1) -1: n in [0..40]]; // G. C. Greubel, Jul 12 2019
    
  • Mathematica
    t = {0, 2}; Do[AppendTo[t, t[[-1]] + t[[-2]] + 1], {n, 2, 40}]; t
    RecurrenceTable[{a[n] == a[n - 1] +a[n - 2] +1, a[0] == 0, a[1] == 2}, a, {n, 0, 40}] (* Robert G. Wilson v, Apr 13 2013 *)
    CoefficientList[Series[x (2 - x)/((1 - x - x^2) (1 - x)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 20 2015 *)
    Table[Fibonacci[n] + Fibonacci[n + 2] - 1, {n, 0, 40}] (* Eric W. Weisstein, Feb 13 2018 *)
    LinearRecurrence[{2, 0, -1}, {2, 3, 6}, 20] (* Eric W. Weisstein, Feb 13 2018 *)
    Table[LucasL[n] - 1, {n, 20}] (* Eric W. Weisstein, Aug 01 2023 *)
    LucasL[Range[20]] - 1 (* Eric W. Weisstein, Aug 01 2023 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -1,0,2]^n*[0;2;3])[1,1] \\ Charles R Greathouse IV, Sep 08 2016
    
  • PARI
    vector(40, n, f=fibonacci; f(n+1)+f(n-1)-1) \\ G. C. Greubel, Jul 12 2019
    
  • Sage
    [lucas_number2(n+1,1,-1) -1 for n in (0..40)] # G. C. Greubel, Jul 12 2019
    

Formula

a(n) = A000204(n)-1 = A000032(n+1)-1 = A000071(n+1) + A000045(n).
G.f.: x*(2-x)/((1-x-x^2)*(1-x)) = (2*x-x^2)/(1-2*x+x^3). [Simon Plouffe in his 1992 dissertation]
a(n) = F(n) + F(n+2) - 1 where F(n) is the n-th Fibonacci number. - Zerinvary Lajos, Jan 31 2008
a(n) = A014217(n+1) - A000035(n+1). - Paul Curtz, Sep 21 2008
a(n) = Sum_{i=1..floor((n+1)/2)} ((n+1)/i)*C(n-i,i-1). In more general case of polynomials Q_n(x)=a(n,x) (see our comment) we have Q_n(x) = Sum_{i=1..floor((n+1)/2)}((n+1)/i)*C(n-i,i-1)*x^(i-1). - Vladimir Shevelev, Apr 23 2010
a(n) = Sum_{k=0..n-1} Lucas(k), where Lucas(n) = A000032(n). - Gary Detlefs, Dec 07 2010
a(0)=0, a(1)=2, a(2)=3; for n>=3, a(n) = 2*a(n-1) - a(n-3). - George F. Johnson, Jan 28 2013
For n > 1, a(n) = A048162(n+1) + 3. - Toby Gottfried, Apr 13 2013
For n > 0, a(n) = A169985(n + 1) - 1. - Gus Wiseman, Feb 12 2019

A000358 Number of binary necklaces of length n with no subsequence 00, excluding the necklace "0".

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 5, 8, 10, 15, 19, 31, 41, 64, 94, 143, 211, 329, 493, 766, 1170, 1811, 2787, 4341, 6713, 10462, 16274, 25415, 39651, 62075, 97109, 152288, 238838, 375167, 589527, 927555, 1459961, 2300348, 3626242, 5721045, 9030451, 14264309, 22542397, 35646312, 56393862, 89264835, 141358275
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the number of inequivalent compositions of n into parts 1 and 2 where two compositions are considered to be equivalent if one is a cyclic rotation of the other. a(6)=5 because we have: 2+2+2, 2+2+1+1, 2+1+2+1, 2+1+1+1+1, 1+1+1+1+1+1. - Geoffrey Critzer, Feb 01 2014
Moebius transform is A006206. - Michael Somos, Jun 02 2019

Examples

			G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 5*x^6 + 5*x^7 + 8*x^8 + 10*x^9 + ... - _Michael Somos_, Jun 02 2019
Binary necklaces are: 1; 01, 11; 011, 111; 0101, 0111, 1111; 01010, 01011, 01111. - _Michael Somos_, Jun 02 2019
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 499.
  • T. Helleseth and A. Kholosha, Bent functions and their connections to combinatorics, in Surveys in Combinatorics 2013, edited by Simon R. Blackburn, Stefanie Gerke, Mark Wildon, Camb. Univ. Press, 2013.

Crossrefs

Column k=0 of A320341.

Programs

  • Maple
    A000358 := proc(n) local sum; sum := 0; for d in divisors(n) do sum := sum + phi(n/d)*(fibonacci(d+1)+fibonacci(d-1)) od; RETURN(sum/n); end;
    with(combstruct); spec := {A=Union(zero,Cycle(one),Cycle(Prod(zero,Sequence(one,card>0)))),one=Atom,zero=Atom}; seq(count([A,spec,unlabeled],size=i),i=1..30);
  • Mathematica
    nn=48;Drop[Map[Total,Transpose[Map[PadRight[#,nn]&,Table[ CoefficientList[ Series[CycleIndex[CyclicGroup[n],s]/.Table[s[i]->x^i+x^(2i),{i,1,n}],{x,0,nn}],x],{n,0,nn}]]]],1] (* Geoffrey Critzer, Feb 01 2014 *)
    max = 50; B[x_] := x*(1+x); A = Sum[EulerPhi[k]/k*Log[1/(1-B[x^k])], {k, 1, max}]/x + O[x]^max; CoefficientList[A, x] (* Jean-François Alcover, Feb 08 2016, after Joerg Arndt *)
    Table[1/n * Sum[EulerPhi[n/d] Total@ Map[Fibonacci, d + # & /@ {-1, 1}], {d, Divisors@ n}], {n, 47}] (* Michael De Vlieger, Dec 28 2016 *)
    a[ n_] := If[ n < 1, 0, DivisorSum[n, EulerPhi[n/#] LucasL[#] &]/n]; (* Michael Somos, Jun 02 2019 *)
  • PARI
    N=66;  x='x+O('x^N);
    B(x)=x*(1+x);
    A=sum(k=1, N, eulerphi(k)/k*log(1/(1-B(x^k))));
    Vec(A)
    /* Joerg Arndt, Aug 06 2012 */
    
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, eulerphi(n/d) * (fibonacci(d+1) + fibonacci(d-1)))/n)}; /* Michael Somos, Jun 02 2019 */
    
  • Python
    from sympy import totient, lucas, divisors
    def A000358(n): return (n&1^1)+sum(totient(n//k)*(lucas(k)-((k&1^1)<<1)) for k in divisors(n,generator=True))//n # Chai Wah Wu, Sep 23 2023

Formula

a(n) = (1/n) * Sum_{ d divides n } totient(n/d) [ Fib(d-1)+Fib(d+1) ].
G.f.: Sum_{k>=1} phi(k)/k * log( 1/(1-B(x^k)) ) where B(x)=x*(1+x). - Joerg Arndt, Aug 06 2012
a(n) ~ ((1+sqrt(5))/2)^n / n. - Vaclav Kotesovec, Sep 12 2014
a(n) = Sum_{0 <= i <= ceiling((n-1)/2)} [ (1/(n - i)) * Sum_{d|gcd(i, n-i)} phi(d) * binomial((n - i)/d, i/d) ]. (This is DeFord's formula for the number of distinct Lucas tilings of a 1 X n bracelet up to symmetry, even though in the paper he refers to sequence A032192(n) = a(n) - 1.) - Petros Hadjicostas, Jun 07 2019

A032278 Number of ways to partition n elements into pie slices each with at least 2 elements allowing the pie to be turned over.

Original entry on oeis.org

0, 1, 1, 2, 2, 4, 4, 7, 8, 13, 15, 25, 30, 48, 63, 98, 132, 208, 290, 454, 656, 1021, 1509, 2358, 3544, 5535, 8441, 13200, 20318, 31835, 49352, 77435, 120710, 189673, 296853, 467159, 733362, 1155646, 1818593, 2869377, 4524080
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000005, A027750, A032190 (CIK, pie not to be turned over).

Programs

  • Maple
    A032278_list := proc(n)
        local ele ;
        ele := [0,seq(1,i=1..30)] ;
        DIK(ele) ; # defined in A032287
    end proc:
    A032278_list(50) ; # R. J. Mathar, Feb 14 2025
  • PARI
    seq(n)={Vec(x^2/((1-x)*(1-x^2-x^4)) + sum(d=1, n, eulerphi(d)/d*log((1-x^d)/(1-x^d-x^(2*d)) + O(x*x^n))), -n)/2} \\ Andrew Howroyd, Jun 20 2018

Formula

"DIK" (bracelet, indistinct, unlabeled) transform of 0, 1, 1, 1, ...
G.f.: (x^2/((1 - x)*(1 - x^2 - x^4)) + Sum_{d>0} phi(d)*log((1 - x^d)/(1 - x^d - x^(2*d)))/d)/2. - Andrew Howroyd, Jun 20 2018

A063686 Triangular array: T(n,k) is the number of binary necklaces (no turning over) of length n whose longest run of 1's has length k. Table begins at n=0, k=0.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 4, 4, 2, 1, 1, 1, 1, 4, 6, 4, 2, 1, 1, 1, 1, 7, 11, 8, 4, 2, 1, 1, 1, 1, 9, 19, 14, 8, 4, 2, 1, 1, 1, 1, 14, 33, 27, 16, 8, 4, 2, 1, 1, 1, 1, 18, 56, 50, 30, 16, 8, 4, 2, 1, 1, 1, 1, 30, 101, 96, 59, 32, 16, 8, 4, 2, 1, 1, 1
Offset: 0

Views

Author

Christopher Lenard (c.lenard(AT)bendigo.latrobe.edu.au), Aug 22 2001

Keywords

Comments

Column k=1 appears to be A032190(n), n=2,3,...

Examples

			Triangle begins:
  1;
  1, 1;
  1, 1, 1;
  1, 1, 1, 1;
  1, 2, 1, 1, 1;
  1, 2, 2, 1, 1, 1;
  1, 4, 4, 2, 1, 1, 1;
  1, 4, 6, 4, 2, 1, 1, 1;
  1, 7, 11, 8, 4, 2, 1, 1, 1;
  1, 9, 19, 14, 8, 4, 2, 1, 1, 1;
  1, 14, 33, 27, 16, 8, 4, 2, 1, 1, 1;
  ...
		

Crossrefs

Cf. A000358, A093305, A280218 (necklaces avoiding 00, 000, 0000).

Programs

  • PARI
    \\ here R(n) is A048887 transposed
    R(n)={Mat(vector(n, k, Col((1-x)/(1-2*x+x^(k+1)) - 1 + O(x*x^n))))}
    S(M)={matrix(#M-1, #M-1, n, k, if(kAndrew Howroyd, Oct 15 2017

Extensions

T(0,0)=1 from Andrew Howroyd, Oct 15 2017
Showing 1-4 of 4 results.