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

A208773 Number of n-bead necklaces labeled with numbers 1..4 not allowing reversal, with no adjacent beads differing by more than 1.

Original entry on oeis.org

4, 7, 10, 18, 30, 65, 128, 293, 658, 1544, 3622, 8711, 20924, 50889, 124150, 304718, 750334, 1855429, 4600696, 11442853, 28528618, 71294416, 178529670, 447923761, 1125756860, 2833917147, 7144466842, 18036449390, 45591671454, 115381885423, 292329164912, 741411257693, 1882219950046, 4782783122992, 12163730636250
Offset: 1

Views

Author

R. H. Hardin, Mar 01 2012

Keywords

Examples

			All solutions for n=3:
..2....4....1....2....1....2....3....3....1....3
..2....4....1....2....1....3....3....4....2....3
..3....4....2....2....1....3....3....4....2....4
		

Crossrefs

Column 4 of A208777.
Cf. A215336 (cyclically smooth Lyndon words with 4 colors).

Programs

  • Mathematica
    sn[n_, k_] := 1/n*Sum[ Sum[ EulerPhi[j]*(1 + 2*Cos[i*Pi/(k + 1)])^(n/j), {j, Divisors[n]}], {i, 1, k}]; Table[sn[n, 4], {n, 1, 35}] // FullSimplify (* Jean-François Alcover, Oct 31 2017, after Joerg Arndt *)
  • PARI
    /* from the Knopfmacher et al. reference */
    default(realprecision,99); /* using floats */
    sn(n,k)=1/n*sum(i=1,k,sumdiv(n,j,eulerphi(j)*(1+2*cos(i*Pi/(k+1)))^(n/j)));
    vector(66,n, round(sn(n,4)) )
    /* Joerg Arndt, Aug 09 2012 */

Formula

a(n) = Sum_{ d | n } A215336(d). - Joerg Arndt, Aug 13 2012
a(n) = (1/n) * Sum_{d | n} totient(n/d) * A124697(n). - Andrew Howroyd, Mar 18 2017

A215500 a(n) = ((sqrt(5) + 3)^n + (-sqrt(5) -1)^n + (-sqrt(5) + 3)^n + (sqrt(5) - 1)^n) / 2^n.

Original entry on oeis.org

4, 2, 10, 14, 54, 112, 340, 814, 2254, 5702, 15250, 39404, 104004, 270922, 711490, 1859134, 4873054, 12748472, 33391060, 87394454, 228841254, 599050102, 1568437210, 4106054164, 10750060804, 28143585362, 73681573690, 192899714414, 505019869254, 1322156172352
Offset: 0

Views

Author

Peter Luschny, Aug 13 2012

Keywords

Comments

Inverse binomial transform is (-1)^n * a(n). - Michael Somos, Jun 02 2014

Examples

			G.f. = 4 + 2*x + 10*x^2 + 14*x^3 + 54*x^4 + 112*x^5 + 340*x^6 + ...
		

Crossrefs

Programs

  • Magma
    I:=[4,2,10,14]; [n le 4 select I[n] else 2*Self(n-1) + 3*Self(n-2) - 4*Self(n-3) + Self(n-4): n in [1..30]]; // G. C. Greubel, Apr 23 2018
  • Maple
    A215500 := x -> ((sqrt(5)+3)^x+(-sqrt(5)-1)^x+(-sqrt(5)+3)^x+(sqrt(5)-1)^x)/2^x;
    seq(simplify(A215500(i)),i=0..29);
  • Mathematica
    a[n_] := ((Sqrt[5] + 3)^n + (-Sqrt[5] - 1)^n + (-Sqrt[5] + 3)^n + (Sqrt[5] - 1)^n)/2^n; Table[a[n] // Simplify, {n, 0, 29}] (* Jean-François Alcover, Jul 02 2013 *)
    LinearRecurrence[{2,3,-4,1}, {4, 2, 10, 14}, 50] (* G. C. Greubel, Apr 23 2018 *)
  • PARI
    {a(n) = polsym( (1 + (-1)^(n>0)*x - x^2) * (1 - 3*x + x^2), abs(n))[1 + abs(n)]}; /* Michael Somos, Jun 02 2014 */
    
  • Sage
    def A215500(x) :
        return ((sqrt(5)+3)^x+(-sqrt(5)-1)^x+(-sqrt(5)+3)^x+(sqrt(5)-1)^x)/2^x
    [A215500(i).round() for i in (0..29)]
    

Formula

G.f.: 2*(2-x)*(1+x)*(1-2*x)/((1-3*x+x^2)*(1+x-x^2)). - Colin Barker, Aug 19 2012
a(n) = 2*a(n-1)+3*a(n-2)-4*a(n-3)+a(n-4). - Colin Barker, Aug 20 2012
a(-n) = A124697(n) if n>0. - Michael Somos, Jun 02 2014
Showing 1-2 of 2 results.