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.

Previous Showing 61-70 of 93 results. Next

A118209 Expansion of Sum_{k>=1} lambda(k) * k * x^k/(1 + x^k) where lambda(k) is the Liouville function, A008836.

Original entry on oeis.org

1, -3, -2, 5, -4, 6, -6, -11, 7, 12, -10, -10, -12, 18, 8, 21, -16, -21, -18, -20, 12, 30, -22, 22, 21, 36, -20, -30, -28, -24, -30, -43, 20, 48, 24, 35, -36, 54, 24, 44, -40, -36, -42, -50, -28, 66, -46, -42, 43, -63, 32, -60, -52, 60, 40, 66, 36, 84, -58, 40, -60, 90, -42, 85, 48, -60, -66, -80, 44, -72, -70, -77, -72, 108, -42
Offset: 1

Views

Author

Stuart Clary, Apr 15 2006

Keywords

Comments

Related to the logarithmic derivative of A118207(x) and A118208(x).
Related to a signed variant of A022998 via Mobius inversion. - R. J. Mathar, Jul 03 2011

Crossrefs

Programs

  • Mathematica
    nmax = 80; lambda[k_Integer?Positive] := If[ k > 1, (-1)^Total[ Part[Transpose[FactorInteger[k]], 2] ], 1 ]; Drop[ CoefficientList[ Series[ Sum[ lambda[k] k x^k/(1 + x^k), {k, 1, nmax} ], {x, 0, nmax} ], x ], 1 ]
    f[p_, e_] := (p*(-p)^e+1)/(p+1); f[2, e_] := ((-1)^e*2^(e+2) - 1)/3; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Aug 12 2023 *)
  • PARI
    a(n) = sumdiv(n, d, (-1)^(n/d - 1)*(-1)^vecsum(factor(d)[,2])*d) \\ Michel Marcus, Dec 10 2016

Formula

a(n) = Sum_{d|n} (-1)^(n/d - 1)*lambda(d)*d, Dirichlet convolution of A061019 and A062157.
G.f.: A(x) is x times the logarithmic derivative of A118207(x).
G.f.: A(x) = A061020(x) - 2 A061020(x^2).
Dirichlet g.f.: zeta(s)*zeta(2s-2)*(1-2^(1-s))/zeta(s-1). - R. J. Mathar, Jul 03 2011
a(n) > 0 for n in A028260. - Michel Marcus, Dec 10 2016
Multiplicative with a(2^e) = ((-1)^e*2^(e+2) - 1)/3, and a(p^e) = (p*(-p)^e+1)/(p+1) for an odd prime p. - Amiram Eldar, Aug 12 2023

A118431 Numerator of sum of reciprocals of first n 5-simplex numbers A000389.

Original entry on oeis.org

1, 7, 17, 69, 625, 209, 329, 247, 357, 1250, 341, 1819, 2379, 3059, 19375, 1211, 1496, 3657, 4427, 53125, 12649, 14949, 17549, 10237, 59375, 6851, 7866, 35959, 40919, 231875, 52359, 14726, 16511, 36907, 205625, 91389, 101269
Offset: 1

Views

Author

Jonathan Vos Post, Apr 28 2006

Keywords

Comments

Denominators are A118432. Fractions are: 1/1, 7/6, 17/14, 69/56, 625/504, 209/168, 329/264, 247/198, 357/286, 1250/1001, 341/273, 1819/1456, 2379/1904, 3059/2448, 19375/15504, 1211/969, 1496/1197, 3657/2926, 4427/3542, 53125/42504, 12649/10120, 14949/11960, 17549/14040, 10237/8190, 59375/47502, 6851/5481, 7866/6293, 35959/28768, 40919/32736, 231875/185504, 52359/41888, 14726/11781, 16511/13209, 36907/29526, 205625/164502, 91389/73112, 101269/81016. The numerator of sum of reciprocals of first n triangular numbers is A026741. The numerator of sum of reciprocals of first n tetrahedral numbers is A118391. The numerator of sum of reciprocals of first n pentatope numbers is A118411.

Examples

			a(1) = 1 = numerator of 1/1.
a(2) = 7 = numerator of 7/6 = 1/1 + 1/6.
a(3) = 17 = numerator of 17/14 = 1/1 + 1/6 + 1/21.
a(4) = 69 = numerator of 69/56 = 1/1 + 1/6 + 1/21 + 1/56.
a(5) = 55 = numerator of 55/42 = 1/1 + 1/6 + 1/21 + 1/56 + 1/126.
a(10) = 1250 = numerator of 1250/1001 = 1/1+ 1/6 + 1/21 + 1/56 + 1/126 + 1/252 + 1/462 + 1/792 + 1/1287 + 1/2002.
a(20) = 53125 = numerator of 53125/42504 = 1/1 + 1/6 + 1/21 + 1/56 + 1/126 + 1/252 + 1/462 + 1/792 + 1/1287 + 1/2002 + 1/3003 + 1/4368 + 1/6188 + 1/8568 + 1/11628 + 1/15504 + 1/20349 + 1/26334 + 1/33649 + 1/42504.
		

Crossrefs

Programs

  • Mathematica
    Numerator[Accumulate[1/Binomial[Range[5, 50], 5]]] (* G. C. Greubel, Nov 21 2017 *)

Formula

A118411(n)/A118412(n) = Sum_{i=1..n} (1/A000389(n)).
A118411(n)/A118412(n) = Sum_{i=1..n} (1/C(n,5)).
A118411(n)/A118412(n) = Sum_{i=1..n} (1/(n*(n+1)*(n+2)*(n+3)*(n+4)/120)).

A166494 Irregular triangle T(n,k) = greatest common divisor of n-th row terms of A143753.

Original entry on oeis.org

3, 8, 5, 5, 12, 12, 7, 7, 7, 16, 16, 16, 9, 9, 9, 9, 20, 20, 20, 20, 11, 11, 11, 11, 11, 24, 24, 24, 24, 24, 13, 13, 13, 13, 13, 13, 28, 28, 28, 28, 28, 28, 15, 15, 15, 15, 15, 15, 15, 32, 32, 32, 32, 32, 32, 32, 17, 17, 17, 17, 17, 17, 17, 17, 36, 36, 36, 36, 36, 36, 36, 36, 19, 19, 19, 19, 19, 19, 19, 19, 19, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 21, 21, 21, 21, 21, 21, 21
Offset: 1

Views

Author

Paul Curtz, Oct 15 2009

Keywords

Examples

			3;
8;
5,5;
12,12;
7,7,7;
16,16,16;
		

Crossrefs

Cf. A166866.

Formula

T(n,k) = A022998(n+2).

A174474 a(n) = (2*n^2 - 2*n - 3)/8 + 3*(-1)^n*(1-2*n)/8.

Original entry on oeis.org

0, 0, -1, 3, 0, 8, 3, 15, 8, 24, 15, 35, 24, 48, 35, 63, 48, 80, 63, 99, 80, 120, 99, 143, 120, 168, 143, 195, 168, 224, 195, 255, 224, 288, 255, 323, 288, 360, 323, 399, 360, 440, 399, 483, 440, 528, 483, 575, 528, 624, 575
Offset: 0

Views

Author

Paul Curtz, Nov 28 2010

Keywords

Comments

First differences are (-1)^n*A022998(n).

Programs

  • Magma
    [(2*n^2-2*n-3)/8+3*(-1)^n*(1-2*n)/8: n in [0..60]]; // Vincenzo Librandi, Aug 04 2011
  • Mathematica
    LinearRecurrence[{1,2,-2,-1,1},{0,0,-1,3,0},60] (* Harvey P. Dale, Jun 01 2015 *)

Formula

Bisections: a(2n) = A067998(n). a(2n+1) = A005563(n).
a(2n) + a(2n+1) = A001105(n).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: x^2*(1 - 4*x + x^2) / ( (1+x)^2*(x-1)^3 ).

A235355 0 followed by the sum of (1),(2), (3,4),(5,6), (7,8,9),(10,11,12) from the natural numbers.

Original entry on oeis.org

0, 1, 2, 7, 11, 24, 33, 58, 74, 115, 140, 201, 237, 322, 371, 484, 548, 693, 774, 955, 1055, 1276, 1397, 1662, 1806, 2119, 2288, 2653, 2849, 3270, 3495, 3976, 4232, 4777, 5066, 5679, 6003, 6688, 7049, 7810, 8210, 9051, 9492, 10417, 10901, 11914, 12443, 13548
Offset: 0

Views

Author

Paul Curtz, Jan 07 2014

Keywords

Comments

Difference table for 0 followed by a(n):
0, 0, 1, 2, 7, 11, 24, 33,...
0, 1, 1, 5, 4, 13, 9, 25,... =A147685(n)
1, 0, 4, -1, 9, -4, 16, -9,... =interleave A000290(n+1),-A000290(n)
-1, 4, -5, 10, -13, 20, -25, 34,...
5, -9, 15, -23, 33, -45, 59, -75,... =(-1)^n*A027688(n+2).
a(-n) = -a(n-1).
From the second row, signature (0,3,0,-3,0,1).
Consider a(n+2k+1)+a(2k-n):
1, 2, 6, 9, 17, 22, 34,...
9, 12, 24, 33, 57, 72, 108,...
35, 40, 60, 75, 115, 140, 200,...
91, 98, 126, 147, 203, 238, 322,...
189, 198, 234, 261, 333, 378, 486,... .
The first column is A005898(n).
The rows are successively divisible by 2*k+1. Hence
1, 2, 6, 9, 17, 22, 34,...
3, 4, 8, 11, 19, 24, 36,...
7, 8, 12, 15, 23, 28, 40,...
13, 14, 18, 21, 29, 34, 46,...
21, 22, 26, 29, 37, 42, 54,...
The first column is A002061(n+1).
The main diagonal is A212965(n).
The first difference of every row is A022998(n+1).
Compare to the (2k+1)-sections of A061037 in A165943.

Examples

			a(1)=1, a(2)=2, a(3)=3+4=7, a(4)=5+6=11, a(5)=7+8+9=24, a(6)=10+11+12=33.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,3,-3,-3,3,1,-1},{0,1,2,7,11,24,33},50] (* Harvey P. Dale, Nov 22 2014 *)
  • PARI
    Vec(x*(x^2+1)*(x^2+x+1)/((x-1)^4*(x+1)^3) + O(x^100)) \\ Colin Barker, Jan 20 2014

Formula

a(n) = 4*a(n-2) -6*a(n-4) +4*a(n-6) -a(n-8), n>7.
a(2n) = 0 followed by A085786(n). a(2n+1) = A081436(n).
a(2n) + a(2n+1) = A005898(n).
a(2n-1) + a(2n) = A061317(n).
a(n) = (-1)*((-1+(-1)^n-2*n)*(2+n+n^2))/16. a(n) = a(n-1)+3*a(n-2)-3*a(n-3)-3*a(n-4)+3*a(n-5)+a(n-6)-a(n-7). G.f.: x*(x^2+1)*(x^2+x+1) / ((x-1)^4*(x+1)^3). - Colin Barker, Jan 20 2014

Extensions

More terms from Colin Barker, Jan 20 2014

A257088 a(2*n) = 4*n if n>0, a(2*n + 1) = 2*n + 1, a(0) = 1.

Original entry on oeis.org

1, 1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32, 17, 36, 19, 40, 21, 44, 23, 48, 25, 52, 27, 56, 29, 60, 31, 64, 33, 68, 35, 72, 37, 76, 39, 80, 41, 84, 43, 88, 45, 92, 47, 96, 49, 100, 51, 104, 53, 108, 55, 112, 57, 116, 59, 120, 61, 124, 63, 128
Offset: 0

Views

Author

Michael Somos, Apr 16 2015

Keywords

Examples

			G.f. = 1 + x + 4*x^2 + 3*x^3 + 8*x^4 + 5*x^5 + 12*x^6 + 7*x^7 + 16*x^8 + ...
		

Crossrefs

CF. A257083 (partial sums), A246695.

Programs

  • Haskell
    import Data.List (transpose)
    a257088 n = a257088_list !! n
    a257088_list = concat $ transpose [a008574_list, a005408_list]
    -- Reinhard Zumkeller, Apr 17 2015
  • Mathematica
    a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], n, True, 2 n];
    a[ n_] := SeriesCoefficient[ (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4), {x, 0, n}];
  • PARI
    {a(n) = if( n<1, n==0, n%2, n, 2*n)};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4) + x * O(x^n), n))};
    

Formula

Euler transform of length 4 sequence [ 1, 3, -1, -1].
a(n) is multiplicative with a(2^e) = 2^(e+1) if e>0, otherwise a(p^e) = p^e.
G.f.: (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4).
G.f.: (1 - x^3) * (1 - x^4) / ((1 - x) * (1 - x^2)^3).
MOBIUS transform of A215947 is [1, 4, 3, 8, 5, ...].
a(n) = n * A040001(n) if n>0.
a(n) + a(n-1) = A007310(n) if n>0.
a(n) = A001082(n+1) - A001082(n) if n>0.
Binomial transform with a(0)=0 is A128543 if n>0.
a(2*n) = A008574(n). a(2*n + 1) = A005408(n).
a(n) = A022998(n) if n>0. - R. J. Mathar, Apr 19 2015
From Amiram Eldar, Jan 28 2025: (Start)
Dirichlet g.f.: (1+2^(1-s)) * zeta(s-1).
Sum_{k=1..n} a(k) ~ (3/4) * n^2. (End)
a(n) = gcd(n^n, 2*n). - Mia Boudreau, Jun 27 2025

A259445 Multiplicative with a(n) = n if n is odd and a(2^s)=2.

Original entry on oeis.org

1, 2, 3, 2, 5, 6, 7, 2, 9, 10, 11, 6, 13, 14, 15, 2, 17, 18, 19, 10, 21, 22, 23, 6, 25, 26, 27, 14, 29, 30, 31, 2, 33, 34, 35, 18, 37, 38, 39, 10, 41, 42, 43, 22, 45, 46, 47, 6, 49, 50, 51, 26, 53, 54, 55, 14, 57, 58, 59, 30, 61, 62, 63, 2, 65, 66, 67, 34
Offset: 1

Views

Author

Keywords

Comments

If n = 2^s*m with m odd and s > 0 then a(n) = 2*m.

Crossrefs

Programs

  • Maple
    A259445 := proc(n::integer)
        local a, pe, p,e ;
        a := 1 ;
        for pe in ifactors(n)[2] do
            p := op(1,pe) ;
            e := op(2,pe) ;
            if p = 2 then
                a := 2*a ;
            else
                a := a*p^e  ;
            end if;
        end do:
        a;
    end proc:
    seq(A259445(n),n=1..80) ; # R. J. Mathar, Feb 21 2025
  • Mathematica
    G[n_] := If[Mod[n, 2] == 0, n/2^(FactorInteger[n][[1, 2]] - 1), n]; Table[G[n], {n, 1, 70}]
  • PARI
    a(n)=n>>max(valuation(n,2)-1,0) \\ Charles R Greathouse IV, Jun 28 2015

Formula

From Peter Bala, Feb 21 2019: (Start)
a(n) = n*gcd(n,2)/gcd(n,2^n).
a(2*n) = 2*A000265(2*n); a(2*n+1) = A000265(2*n+1).
O.g.f.: x*(1 + 4*x + x^2)/(1 - x^2)^2 - 2*( F(x^2) + F(x^4) + F(x^8) + ... ), where F(x) = x/(1 - x)^2.
O.g.f. for reciprocals: Sum_{n >= 1} (1/a(n))*x^n = (3/4)*L(x) - (1/4)*L(-x) + (1/4)*( L(x^2) + L(x^4) + L(x^8) + ... ), where L(x) = log(1/(1 - x)).
(End)
From Peter Bala, Mar 09 2019: (Start)
a(n) = (-1)^(n+1)*Sum_ {d divides n} (-1)^(d+n/d)*phi(d), where phi(n) = A000010(n) is the Euler totient function. Cf. the identity n = Sum_ {d divides n} phi(d). Cf. A046897 and A321558.
O.g.f.: Sum_{n >= 1} phi(n)*x^n/(1 + (-x)^n). (End)
From Amiram Eldar, Nov 28 2022: (Start)
Dirichlet g.f.: zeta(s-1)*(1 + 1/2^(s-1) - 2/(2^s-1)).
Sum_{k=1..n} a(k) ~ (5/12) * n^2. (End)
a(n) = n /A160467(n). - R. J. Mathar, Feb 21 2025

A283971 a(n) = n except a(4*n + 2) = 2*n + 1.

Original entry on oeis.org

0, 1, 1, 3, 4, 5, 3, 7, 8, 9, 5, 11, 12, 13, 7, 15, 16, 17, 9, 19, 20, 21, 11, 23, 24, 25, 13, 27, 28, 29, 15, 31, 32, 33, 17, 35, 36, 37, 19, 39, 40, 41, 21, 43, 44, 45, 23, 47, 48, 49, 25, 51, 52, 53, 27, 55, 56, 57, 29, 59, 60, 61, 31, 63, 64, 65, 33, 67
Offset: 0

Views

Author

Paul Curtz, Mar 18 2017

Keywords

Comments

From Federico Provvedi, Nov 13 2018: (Start)
For n > 1, a(n) is also the cycle length generated by the cycle lengths of the digital roots, in base n, of the powers of k, with k > 0.
Example for n=10 (decimal base): for every h >= 0, the digital roots of 2^h generate a periodic cycle {1,2,4,8,7,5} with period 6; 3^h generates {1,3,9,9,9,9,...} so the periodic cycle {9} has period 1; 4^h generates the periodic cycle {1,4,7} with period 3; etc. So, for n=10 (decimal base representation) the sequence generated by the periods of the digital roots of powers of k (with k > 0) is also periodic {1,6,1,3,6,1,3,2,1} with period 9, hence a(10) = 9. (End)

Crossrefs

Programs

  • GAP
    a:=[0,1,1,3,4,5,3,7];; for n in [9..85] do a[n]:=2*a[n-4]-a[n-8]; od; a; # Muniru A Asiru, Jul 20 2018
    
  • Maple
    seq(coeff(series(x*(1+x+3*x^2+4*x^3+3*x^4+x^5+x^6)/((1-x)^2*(1+x)^2*(1+x^2)^2), x,n+1),x,n),n=0..80); # Muniru A Asiru, Jul 20 2018
  • Mathematica
    Table[If[Mod[n, 4] == 2, (n - 2)/2 + 1, n], {n, 67}] (* or *)
    CoefficientList[Series[x (1 + x + 3 x^2 + 4 x^3 + 3 x^4 + x^5 + x^6)/((1 - x)^2*(1 + x)^2*(1 + x^2)^2), {x, 0, 67}], x] (* Michael De Vlieger, Mar 19 2017 *)
    LinearRecurrence[{0, 0, 0, 2, 0, 0, 0, -1}, {0, 1, 1, 3, 4, 5, 3, 7}, 70] (* Robert G. Wilson v, Jul 23 2018 *)
    Table[Length[FindTransientRepeat[(Length[FindTransientRepeat[Mod[#1^Range[b]-1,b-1]+1,2][[2]]]&)/@Range[2, 2*b], 2][[2]]], {b, 2, 100}] (* Federico Provvedi, Nov 13 2018 *)
  • PARI
    a(n)=if(n%4==2, n\4*2 + 1, n) \\ Charles R Greathouse IV, Mar 18 2017
    
  • PARI
    concat(0, Vec(x*(1 + x + 3*x^2 + 4*x^3 + 3*x^4 + x^5 + x^6) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2) + O(x^40))) \\ Colin Barker, Mar 19 2017
    
  • Python
    def A283971(n): return n if (n-2)&3 else n>>1 # Chai Wah Wu, Jan 10 2023

Formula

a(2*n) = A022998(n), a(1+2*n) = 1 + 2*n.
a(n) = 2*a(n-4) - a(n-8).
From Colin Barker, Mar 19 2017: (Start)
G.f.: x*(1 + x + 3*x^2 + 4*x^3 + 3*x^4 + x^5 + x^6) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2).
a(n) = -((-1)^n - (-i)^n - i^n - 7)*n/8, where i = sqrt(-1).
(End)
a(n) = A060819(n) * periodic sequence of length 4: repeat [4, 1, 1, 1].
a(n) = a(n-4) + periodic sequence of length 4: repeat [4, 4, 2, 4].
From Werner Schulte, Jul 08 2018: (Start)
For n > 0, a(n) is multiplicative with a(p^e) = p^e for prime p >= 2 and e >= 0 except a(2^1) = 1.
Dirichlet g.f.: (1 - 1/2^s - 1/2^(2*s-1)) * zeta(s-1).
(End)
a(n) = n*(7 + cos(n*Pi/2) - cos(n*Pi) + cos(3*n*Pi/2))/8. - Wesley Ivan Hurt, Oct 04 2018
E.g.f.: (1/4)*x*(4*cosh(x) - sin(x) + 3*sinh(x)). - Franck Maminirina Ramaharo, Nov 13 2018
Sum_{k=1..n} a(k) ~ (7/16) * n^2. - Amiram Eldar, Nov 28 2022

A317326 Multiples of 26 and odd numbers interleaved.

Original entry on oeis.org

0, 1, 26, 3, 52, 5, 78, 7, 104, 9, 130, 11, 156, 13, 182, 15, 208, 17, 234, 19, 260, 21, 286, 23, 312, 25, 338, 27, 364, 29, 390, 31, 416, 33, 442, 35, 468, 37, 494, 39, 520, 41, 546, 43, 572, 45, 598, 47, 624, 49, 650, 51, 676, 53, 702, 55, 728, 57, 754, 59, 780, 61, 806, 63, 832, 65, 858, 67, 884, 69
Offset: 0

Views

Author

Omar E. Pol, Jul 25 2018

Keywords

Comments

a(n) is the length of the n-th line segment of the rectangular spiral whose vertices are the generalized 30-gonal numbers (A316729).
Partial sums give the generalized 30-gonal numbers.
More generally, the partial sums of the sequence formed by the multiples of m and the odd numbers interleaved, give the generalized k-gonal numbers, with m >= 1 and k = m + 4.
From Bruno Berselli, Jul 27 2018: (Start)
Also, this type of sequence is characterized by:
O.g.f.: x*(1 + m*x + x^2)/(1 - x^2)^2;
E.g.f.: x*(2 - m + (2 + m)*exp(2*x))*exp(-x)/4;
a(n) = -a(-n) = (2 + m - (2 - m)*(-1)^n)*n/4;
a(n) = (m/2)^((1 + (-1)^n)/2)*n;
a(n) = 2*a(n-2) - a(n-4), with signature (0,2,0,-1). (End)

Crossrefs

Cf. A252994 and A005408 interleaved.
Column 26 of A195151.
Sequences whose partial sums give the generalized k-gonal numbers: A026741 (k=5), A001477 (k=6), zero together with A080512 (k=7), A022998 (k=8), A195140 (k=9), zero together with A165998 (k=10), A195159 (k=11), A195161 (k=12), A195312 (k=13), A195817 (k=14), A317311 (k=15), A317312 (k=16), A317313 (k=17), A317314 (k=18), A317315 (k=19), A317316 (k=20), A317317 (k=21), A317318 (k=22), A317319 (k=23), A317320 (k=24), A317321 (k=25), A317322 (k=26), A317323 (k=27), A317324 (k=28), A317325 (k=29), this sequence (k=30).
Cf. A316729.

Programs

  • Julia
    [13^div(1+(-1)^n,2)*n for n in 0:70] |> println # Bruno Berselli, Jul 28 2018
  • Mathematica
    Table[(7 + 6 (-1)^n) n, {n, 0, 70}] (* Bruno Berselli, Jul 27 2018 *)

Formula

a(2*n) = 26*n, a(2*n+1) = 2*n + 1.
From Bruno Berselli, Jul 27 2018: (Start)
O.g.f.: x*(1 + 26*x + x^2)/(1 - x^2)^2.
E.g.f.: x*(-6 + 7*exp(2*x))*exp(-x).
a(n) = -a(-n) = (7 + 6*(-1)^n)*n.
a(n) = 13^((1 + (-1)^n)/2)*n.
a(n) = 2*a(n-2) - a(n-4). (End)
Multiplicative with a(2^e) = 13*2^e, and a(p^e) = p^e for an odd prime p. - Amiram Eldar, Oct 14 2023
Dirichlet g.f.: zeta(s-1) * (1 + 3*2^(3-s)). - Amiram Eldar, Oct 26 2023

A323712 Number of the following described shuffles required to return a deck of n cards to its original state. Create two piles by alternating a card from the top of the deck left-right-left-right until the deck is exhausted. Then, placing the left pile on top of the right pile constitutes one shuffle.

Original entry on oeis.org

1, 1, 3, 4, 4, 6, 6, 3, 9, 5, 5, 12, 12, 4, 12, 8, 8, 9, 9, 6, 6, 22, 22, 20, 20, 9, 27, 28, 28, 10, 10, 5, 15, 12, 12, 36, 36, 12, 12, 20, 20, 7, 7, 12, 36, 46, 46, 42, 42, 8, 24, 52, 52, 20, 20, 9, 9, 29, 29, 60, 60, 6, 18, 12, 12, 33, 33, 22, 66, 70, 70, 18
Offset: 1

Views

Author

David Lovler, Jan 24 2019

Keywords

Comments

The card shuffling procedure is the same for even n and odd n.
Here are a few conjectures.
a(n) <= n for all n.
a(p)=a(p-1) and a(p)|p-1 when p is a prime >= 5.
a(n)=a(n-1) and a(n)|n-1 for nonprimes 341=31*11 and 22369621=8191*2731 and probably other pseudoprimes of the form p*((p+2)/3) where p is a Mersenne prime and (p+2)/3 is prime.
n cards are returned to their original state after n shuffles when n=1, 3, 4, 6, 9, 12, 22, 27, 28, 36, 46, 52, 60, 70, 78, 81, ... (A373461) . These values of n are either of the form p-1 where p is an odd prime number or 3^i, i >= 0.
a(c) is relatively small (compared with nearby values) when c is a Catalan number.
a(2n+1)=3*a(2n) or a(2n+1)=a(2n) for all n.

Examples

			For n=4, {a1,a2,a3,a4}-->{a3,a1,a4,a2}-->{a4,a3,a2,a1}-->{a2,a4,a1,a3}-->{a1,a2,a3,a4}, so a(4)=4.
For n=5, {a1,a2,a3,a4,a5}-->{a5,a3,a1,a4,a2}-->{a2,a1,a5,a4,a3}-->{a3,a5,a2,a4,a1}-->{a1,a2,a3,a4,a5}, so a(5)=4.
		

Crossrefs

Cf. A024222, A022998, A163776, A373416 (fixed points).

Programs

  • Maple
    pileShuf := proc(L::list)
        local i,n,shf ;
        shf := [] ;
        n := nops(L) ;
        if type(n,'odd') then
            for i from n to 1 by -2 do
                shf := [op(shf),op(i,L)] ;
            end do:
            for i from n-1 to 2 by -2 do
                shf := [op(shf),op(i,L)] ;
            end do:
        else
            for i from n-1 to 1 by -2 do
                shf := [op(shf),op(i,L)] ;
            end do:
            for i from n to 2 by -2 do
                shf := [op(shf),op(i,L)] ;
            end do:
        end if;
        shf ;
    end proc:
    A323712 := proc(n)
        local L,itr,isord,i;
        L := [seq(i,i=1..n)] ;
        for itr from 1 to n! do
            L := pileShuf(L) ;
            isord := true ;
            for i from 1 to nops(L) do
                if op(i,L) <> i then
                    isord := false ;
                    break ;
                end if;
            end do:
            if isord then
                return itr ;
            end if;
        end do:
        -1 ;
    end proc:
    seq(A323712(n),n=1..50) ; # R. J. Mathar, Aug 02 2024
  • PARI
    perm(n, vn) = {my(va = List(), vb = List()); for (k=1, n, if (k % 2, listput(va, vn[k]), listput(vb, vn[k]));); Vec(concat(Vecrev(va), Vecrev(vb)));}
    a(n) = {my(vn = vector(n,k,k), vs = perm(n, vn), nb = 1); while (vs != vn, vs = perm(n, vs); nb++); nb;} \\ Michel Marcus, Feb 06 2019

Formula

a(2^m) = m if m is odd, a(2^m) = 2m if m is even. - Alois P. Heinz, Feb 15 2019
Previous Showing 61-70 of 93 results. Next