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.

A048647 Write n in base 4, then replace each digit '1' with '3' and vice versa and convert back to decimal.

Original entry on oeis.org

0, 3, 2, 1, 12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 48, 51, 50, 49, 60, 63, 62, 61, 56, 59, 58, 57, 52, 55, 54, 53, 32, 35, 34, 33, 44, 47, 46, 45, 40, 43, 42, 41, 36, 39, 38, 37, 16, 19, 18, 17, 28, 31, 30, 29, 24, 27, 26, 25, 20, 23, 22, 21, 192, 195, 194, 193, 204, 207, 206
Offset: 0

Views

Author

John W. Layman, Jul 05 1999

Keywords

Comments

The graph of a(n) on [ 1..4^k ] resembles a plane fractal of fractal dimension 1.
Self-inverse considered as a permutation of the integers.
First 4^n terms of the sequence form a permutation s(n) of 0..4^n-1, n>=1; the number of inversions of s(n) is A115490(n). - Gheorghe Coserea, Apr 23 2018

Examples

			a(15)=5, since 15 = 33_4 -> 11_4 = 5.
		

Crossrefs

Column k=4 of A248813.

Programs

  • C
    uint32_t a(uint32_t n) { return n ^ ((n & 0x55555555) << 1); } // Falk Hüffner, Jan 22 2022
  • Haskell
    a048647 0 = 0
    a048647 n = 4 * a048647 n' + if m == 0 then 0 else 4 - m
                where (n', m) = divMod n 4
    -- Reinhard Zumkeller, Apr 08 2013
    
  • Maple
    f:= proc(n)
    option remember;
    local m, r;
    m:= n mod 4;
    r:= 4*procname((n-m)/4);
    if m = 0 then r else r + 4-m fi;
    end proc:
    f(0):= 0:
    seq(f(n),n=0..100); # Robert Israel, Nov 03 2014
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 0,
          a(iquo(n, 4, 'r'))*4+[0, 3, 2, 1][r+1])
        end:
    seq(a(n), n=0..70);  # Alois P. Heinz, Jan 25 2022
  • Mathematica
    Table[FromDigits[If[#==0,0,4-#]&/@IntegerDigits[n,4],4],{n,0,70}] (* Harvey P. Dale, Jul 23 2012 *)
  • PARI
    a(n)=fromdigits(apply(d->if(d,4-d),digits(n,4)),4) \\ Charles R Greathouse IV, Jun 23 2017
    
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        return int("".join(str(4 - d) if d!=0 else '0' for d in digits(n, 4)[1:]), 4)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 26 2017
    
  • Python
    def A048647(n): return n^((n&((1<<(m:=n.bit_length())+(m&1))-1)//3)<<1) # Chai Wah Wu, Jan 29 2023
    

Formula

a(n) = if n = 0 then 0 else 4*a(floor(n/4)) + if m = 0 then 0 else 4 - m, where m = n mod 4. - Reinhard Zumkeller, Apr 08 2013
G.f. g(x) satisfies: g(x) = 4*(1+x+x^2+x^3)*g(x^4) + (3*x+2*x^2+x^3)/(1-x^4). - Robert Israel, Nov 03 2014

A053291 Nonsingular n X n matrices over GF(4).

Original entry on oeis.org

1, 3, 180, 181440, 2961100800, 775476766310400, 3251791214634074112000, 218210695042457748180566016000, 234298374547168764346587444978647040000, 4025200069765920285793155323595159699896401920000, 1106437515026051855463365435310419366987397763763798016000000
Offset: 0

Views

Author

Stephen G Penrice, Mar 04 2000

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [&*[(4^n - 4^k): k in [0..n-1]]: n in [1..8]]; // Bruno Berselli, Jan 28 2013
    
  • Mathematica
    Table[Product[4^n - 4^k, {k,0,n-1}], {n,0,10}] (* Geoffrey Critzer, Jan 26 2013 *)
  • PARI
    for(n=0,10, print1(prod(k=0,n-1, 4^n - 4^k), ", ")) \\ G. C. Greubel, May 31 2018

Formula

a(n) = (4^n - 1)*(4^n - 4)*...*(4^n - 4^(n-1)).
a(n) = A053763(n)*A027637(n). - Bruno Berselli, Jan 30 2013
From Amiram Eldar, Jul 06 2025: (Start)
a(n) = Product_{k=1..n} A115490(k).
a(n) ~ c * 4^(n^2), where c = A100221. (End)

Extensions

More terms from Vladeta Jovovic, Mar 16 2000

A166984 a(n) = 20*a(n-1) - 64*a(n-2) for n > 1; a(0) = 1, a(1) = 20.

Original entry on oeis.org

1, 20, 336, 5440, 87296, 1397760, 22368256, 357908480, 5726601216, 91625881600, 1466015154176, 23456246661120, 375299963355136, 6004799480791040, 96076791961092096, 1537228672451215360, 24595658763514413056, 393530540233410478080, 6296488643803287126016
Offset: 0

Views

Author

Klaus Brockhaus, Oct 26 2009

Keywords

Comments

Partial sums of A166965.
First differences of A006105. - Klaus Purath, Oct 15 2020

Crossrefs

Programs

  • Magma
    [n le 2 select 19*n-18 else 20*Self(n-1)-64*Self(n-2): n in [1..17] ];
    
  • Mathematica
    LinearRecurrence[{20,-64},{1,20},30] (* Harvey P. Dale, Jul 04 2012 *)
  • PARI
    a(n) = (4*16^n - 4^n)/3 \\ Charles R Greathouse IV, Jun 21 2022
    
  • SageMath
    A166984=BinaryRecurrenceSequence(20,-64,1,20)
    [A166984(n) for n in range(31)] # G. C. Greubel, Oct 02 2024

Formula

a(n) = (4*16^n - 4^n)/3.
G.f.: 1/((1-4*x)*(1-16*x)).
Limit_{n -> oo} a(n)/a(n-1) = 16.
a(n) = A115490(n+1)/3.
Sum_{n>=0} a(n) x^(2*n+4)/(2*n+4)! = ( sinh(x) )^4/4!. - Robert A. Russell, Apr 03 2013
From Klaus Purath, Oct 15 2020: (Start)
a(n) = A002450(n+1)*(A002450(n+2) - A002450(n))/5.
a(n) = (A083584(n+1)^2 - A083584(n)^2)/80. (End)
a(n) = (A079598(n) - A000302(n))/24. - César Aguilera, Jun 21 2022
a(n) = 16*a(n-1) + 4^n with a(0) = 1. - Nadia Lafreniere, Aug 08 2022
E.g.f.: (4/3)*exp(10*x)*sinh(6*x + log(2)). - G. C. Greubel, Oct 02 2024

A120362 Numerators of bivariate Taylor expansion of the incomplete elliptic integral of the second kind.

Original entry on oeis.org

1, 0, -1, 0, 4, -3, 0, -16, 60, -45, 0, 64, -1008, 2520, -1575, 0, -256, 16320, -105840, 189000, -99225, 0, 1024, -261888, 4055040, -15800400, 21829500, -9823275, 0, -4096, 4193280, -149909760, 1153152000, -3178375200, 3575672100, -1404728325, 0, 16384, -67104768, 5459650560
Offset: 1

Views

Author

R. J. Mathar, Jun 26 2006

Keywords

Comments

Table has only rows for odd h because all coefficients for even h are zero:
=====|=======================================================================
h \ s| 0 1 2 3 4 5 6
-----|-----------------------------------------------------------------------
1 | 1
3 | 0 -1
5 | 0 4 -3
7 | 0 -16 60 -45
9 | 0 64 -1008 2520 -1575
11 | 0 -256 16320 -105840 189000 -99225
13 | 0 1024 -261888 4055040 -15800400 21829500 -9823275
15 | 0 -4096 4193280 -149909760 1153152000 -3178375200 3575672100
17 | 0 16384 -67104768 5459650560 -79048569600 390486096000 -829555927200
...
From Francesco Franco, Jan 12 2016: (Start)
Conjecture:
If t(h,s) is any term of the previous table after the first column (s>0), then:
t(h,s) = -( 4*s^2*t(h-2,s) + Sum_{j=0..s-1} (t(h-2,j) + t(h,j)) ), with t(1,0) = 1, t(h,0) = 0 for h>1 and t(h,s) = 0 for odd h = 1..2*s-1.
Version without the summation:
t(h,s) = -( 4*s^2*t(h-2,s) - (4*(s-1)^2-1)*t(h-2,s-1) ).
Some example (starting from j=1 in the summation):
t(11,3) = -( 4*t(9,3)*3^2 + Sum_{j=1..2} (t(9,j) + t(11,j)) ) = -( 4*2520*9 + (64-256) + (-1008+16320) ) = -105840; second version:
t(17,5) = -( 4*5^2*t(15,5) - (4*4^2-1)*t(15,4) ) = -( 4*25*(-3178375200) - 63*1153152000 ) = 390486096000.
Also:
t(h,1) = (-1)^(h/2-1/2)*A000302(h/2-3/2) for h>1;
t(h,2) = (-1)^(h/2-3/2)*A115490(h/2-3/2) for h>3;
a(A000124(n)) = 0.
(End)

Examples

			E(m,phi) = phi - m*phi^3/3! + (4*m-3*m^2)*phi^5/5! + (-16*m+60*m^2-45*m^3)*phi^7/7! + ...
so the first row (order phi^1) is a(1,1)=1 for the coefficient of phi,
the second row (order phi^3) is a(2,0)=0 for the missing coefficient of m^0*phi^3, and a(2,1)=-1 for the coefficient of m^1*phi^3/3!.
		

Crossrefs

Cf. A010370, A079484 (diagonal).

Programs

  • Maple
    an := proc(m,n,s) local f: f := coeftayl(EllipticE(sin(phi),m^(1/2)),phi=0,n); coeftayl(f*n!,m=0,s) ; end: nmax := 27 ; for n from 1 to nmax by 2 do for s from 0 to (n-1)/2 do printf("%d,",an(m,n,s)) ; od ; od;
  • Mathematica
    a[n_, s_] := SeriesCoefficient[EllipticE[phi, m], {phi, 0, n}, {m, 0, s}]*n!; Table[a[n, s], {n, 1, 17, 2}, {s, 0, n/2}] // Flatten (* Jean-François Alcover, Jan 06 2014 *)
  • PARI
    {T(n, k) = my(m = 2*n+1); if( k<0 || nMichael Somos, May 04 2017 */

Formula

E(m,phi) = Int_{theta=0..phi} sqrt(1-m*sin^2 theta) d theta.
E(m,phi) = Sum_{n=1,3,5,7,9,...} ( Sum_{s=0..(n-1)/2} a( (n+1)/2,s ) * m^s )*phi^n/n!.
Showing 1-4 of 4 results.