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.

A124807 Number of base-6 circular n-digit numbers with adjacent digits differing by 2 or less.

Original entry on oeis.org

1, 6, 24, 84, 332, 1336, 5478, 22658, 94196, 392664, 1639274, 6849002, 28627874, 119688094, 500456806, 2092720174, 8751273556, 36596513060, 153042707976, 640011807436, 2676483843602, 11192882945426, 46807955443900
Offset: 0

Views

Author

R. H. Hardin, Dec 28 2006

Keywords

Comments

[Empirical] a(base,n) = a(base-1,n) + A005191(n+1) for base >= 2*floor(n/2) + 1.

Crossrefs

Programs

  • Magma
    I:=[1,6,24,84,332,1336,5478]; [n le 7 select I[n] else 6*Self(n-1) -6*Self(n-2) -8*Self(n-3) +5*Self(n-4) +2*Self(n-5) -Self(n-6): n in [1..41]]; // G. C. Greubel, Aug 04 2023
    
  • Mathematica
    LinearRecurrence[{6,-6,-8,5,2,-1}, {1,6,24,84,332,1336,5478}, 35] (* G. C. Greubel, Aug 04 2023 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A124807
        if (n<7): return (1,6,24,84,332,1336,5478)[n]
        else: return 6*a(n-1) -6*a(n-2) -8*a(n-3) +5*a(n-4) +2*a(n-5) -a(n-6)
    [a(n) for n in range(41)] # G. C. Greubel, Aug 04 2023

Formula

From Colin Barker, Jun 04 2017: (Start)
G.f.: (1 - 6*x^2 - 16*x^3 + 15*x^4 + 8*x^5 - 5*x^6) / ((1 - 4*x - x^2 + x^3)*(1 - 2*x - x^2 + x^3)).
a(n) = 6*a(n-1) - 6*a(n-2) - 8*a(n-3) + 5*a(n-4) + 2*a(n-5) - a(n-6) for n > 6.
(End)
a(n) = -5*[n=0] + 3*A006054(n+2) - 4*A006054(n+1) - A006054(n) + 3*A364705(n) - 8*A364705(n-1) - A364705(n-2). - G. C. Greubel, Aug 04 2023

A126393 Number of base 6 n-digit numbers with adjacent digits differing by two or less.

Original entry on oeis.org

1, 6, 24, 100, 418, 1748, 7310, 30570, 127842, 534628, 2235784, 9349922, 39100844, 163517514, 683820978, 2859700582, 11959105792, 50012302772, 209148616298, 874647662172, 3657726962214, 15296406894730, 63968706878962
Offset: 0

Views

Author

R. H. Hardin, Dec 28 2006

Keywords

Comments

a(base,n) = a(base-1,n) + 5^(n-1) for base >= 2*n - 1.
a(base,n) = a(base-1,n) + 5^(n-1) - 2 when base = 2*(n-1).

Crossrefs

Cf. Base 6 differing by one or less A126360.
Cf. A364705.

Programs

  • Magma
    I:=[1,6,24,100]; [n le 4 select I[n] else 4*Self(n-1) +Self(n-2) -Self(n-3): n in [1..41]]; // G. C. Greubel, Aug 08 2023
    
  • Mathematica
    LinearRecurrence[{4,1,-1}, {1,6,24,100}, 41] (* G. C. Greubel, Aug 08 2023 *)
  • SageMath
    @CachedFunction
    def a(n): # A126393
        if (n<4): return (1,6,24,100)[n]
        else: return 4*a(n-1) +a(n-2) -a(n-3)
    [a(n) for n in range(41)] # G. C. Greubel, Aug 08 2023

Formula

G.f.: 1 + 2*x*(3-x^2)/(1-4*x-x^2+x^3). - R. J. Mathar, Jun 06 2013
a(n) = [n=0] + 6*A364705(n) - 2*A364705(n-2). - G. C. Greubel, Aug 08 2023
Showing 1-2 of 2 results.