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-10 of 22 results. Next

A180200 a(0)=0, a(1)=1; for n > 1, a(n) = 2*m + 1 - (n mod 2 + m mod 2) mod 2, where m = a(floor(n/2)).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

Permutation of the natural numbers with inverse A180201;
A180198(n) = a(a(n));
a(A180199(n)) = A180199(a(n)) = A180201(n);
a(A075427(n)) = A075427(n).
This permutation transforms the enumeration system of positive irreducible fractions A007305/A047679 (Stern-Brocot) into the enumeration system A245325/A245326, and enumeration system A162909/A162910 (Bird) into A071766/A229742 (HCS). - Yosu Yurramendi, Jun 09 2015

Crossrefs

Programs

  • C
    #include 
    int a(int n){
        int m;
        if (n<2){return n;}
        else{
            m=a(n/2);
            return 2*m  + 1 - (n%2 + m%2)%2;
        }
    }
    int main()
    {
        int n=0;
        for(; n<=100; n++)
        printf("%d, ", a(n));
        return 0;
    } /* Indranil Ghosh, Apr 05 2017 */
    
  • Maple
    a:= proc(n) option remember; `if`(n<2, n, (m->
          2*m+1-irem(m+n, 2))(a(iquo(n, 2))))
        end:
    seq(a(n), n=0..72);  # Alois P. Heinz, May 29 2021
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = 2 # + 1 - Mod[Mod[n, 2] + Mod[#, 2], 2] &@ a[Floor[n/2]]; Table[a@ n, {n, 0, 72}] (* Michael De Vlieger, Apr 02 2017 *)
  • PARI
    a(n) = if(n<2, n, my(m=a(n\2)); 2*m + 1 - (n%2 + m%2)%2); \\ Indranil Ghosh, Apr 05 2017
    
  • Python
    def a(n):
        if n<2:return n
        else:
            m=a(n//2)
            return 2*m + 1 - (n%2 + m%2)%2 # Indranil Ghosh, Apr 05 2017
    
  • R
    maxn <- 63 # by choice
    a <- 1
    for(n in 1:maxn){
    a[2*n  ] <- 2*a[n] + (a[n]%%2 == 0)
    a[2*n+1] <- 2*a[n] + (a[n]%%2 != 0)}
    a <- c(0,a)
    # Yosu Yurramendi, May 23 2020

Formula

a(n) = A258746(A233279(n)) = A233279(A117120(n)), n > 0. - Yosu Yurramendi, Apr 10 2017 [Corrected by Yosu Yurramendi, Mar 14 2025]
a(0) = 0, a(1) = 1, for n > 0 a(2*n) = 2*a(n) + [a(n) even], a(2*n + 1) = 2*a(n) + [a(n) odd]. - Yosu Yurramendi, May 23 2020
a(n) = A054429(A154435(n)) = A006068(A054429(n)), n > 0. - Yosu Yurramendi, Jun 05 2021

Extensions

Name edited by Jon E. Schoenfield, Apr 05 2017

A194005 Triangle of the coefficients of an (n+1)-th order differential equation associated with A103631.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 3, 3, 1, 1, 5, 4, 6, 3, 1, 1, 6, 5, 10, 6, 4, 1, 1, 7, 6, 15, 10, 10, 4, 1, 1, 8, 7, 21, 15, 20, 10, 5, 1, 1, 9, 8, 28, 21, 35, 20, 15, 5, 1, 1, 10, 9, 36, 28, 56, 35, 35, 15, 6, 1, 1, 11, 10, 45, 36, 84, 56, 70, 35, 21, 6, 1
Offset: 0

Views

Author

Johannes W. Meijer and A. Hirschberg (a.hirschberg(AT)tue.nl), Aug 11 2011

Keywords

Comments

This triangle is a companion to Parks' triangle A103631.
The coefficients of triangle A103631(n,k) appear in appendix 2 of Park’s remarkable article “A new proof of the Routh-Hurwitz stability criterion using the second method of Liapunov” if we assume that the b(n) coefficients are all equal to 1, see the second Maple program.
The a(n,k) coefficients of the triangle given above are related to the coefficients of a linear (n+1)-th order differential equation for the case b(n)=1, see the examples.
a(n,k) is also the number of symmetric binary strings of odd length n with Hamming weight k>0 and no consecutive 1's. - Christian Barrientos and Sarah Minion, Feb 27 2018

Examples

			For the 5th-order linear differential equation the coefficients a(k) are: a(0) = 1, a(1) = a(4,0) = 1, a(2) = a(4,1) = 4, a(3) = a(4,2) = 3, a(4) = a(4,3) = 3 and a(5) = a(4,4) = 1.
The corresponding Hurwitz matrices A(k) are, see Parks: A(5) = Matrix([[a(1),a(0),0,0,0], [a(3),a(2),a(1),a(0),0], [a(5),a(4),a(3),a(2),a(1)], [0,0,a(5),a(4),a(3)], [0,0,0,0,a(5)]]), A(4) = Matrix([[a(1),a(0),0,0], [a(3),a(2),a(1),a(0)], [a(5),a(4),a(3),a(2)], [0,0,a(5),a(4)]]), A(3) = Matrix([[a(1),a(0),0], [a(3),a(2),a(1)], [a(5),a(4),a(3)]]), A(2) = Matrix([[a(1),a(0)], [a(3),a(2)]]) and A(1) = Matrix([[a(1)]]).
The values of b(k) are, see Parks: b(1) = d(1), b(2) = d(2)/d(1), b(3) = d(3)/(d(1)*d(2)), b(4) = d(1)*d(4)/(d(2)*d(3)) and b(5) = d(2)*d(5)/(d(3)*d(4)).
These a(k) values lead to d(k) = 1 and subsequently to b(k) = 1 and this confirms our initial assumption, see the comments.
'
Triangle starts:
  [0] 1;
  [1] 1, 1;
  [2] 1, 2, 1;
  [3] 1, 3, 2,  1;
  [4] 1, 4, 3,  3,  1;
  [5] 1, 5, 4,  6,  3,  1;
  [6] 1, 6, 5, 10,  6,  4,  1;
  [7] 1, 7, 6, 15, 10, 10,  4,  1;
  [8] 1, 8, 7, 21, 15, 20, 10,  5, 1;
  [9] 1, 9, 8, 28, 21, 35, 20, 15, 5, 1;
		

Crossrefs

Cf. A065941 and A103631.
Triangle sums (see A180662): A000071 (row sums; alt row sums), A075427 (Kn22), A000079 (Kn3), A109222(n+1)-1 (Kn4), A000045 (Fi1), A034943 (Ca3), A001519 (Gi3), A000930 (Ze3)
Interesting diagonals: T(n,n-4) = A189976(n+5) and T(n,n-5) = A189980(n+6)
Cf. A052509.

Programs

  • Haskell
    a194005 n k = a194005_tabl !! n !! k
    a194005_row n = a194005_tabl !! n
    a194005_tabl = [1] : [1,1] : f [1] [1,1] where
       f row' row = rs : f row rs where
         rs = zipWith (+) ([0,1] ++ row') (row ++ [0])
    -- Reinhard Zumkeller, Nov 22 2012
  • Maple
    A194005 := proc(n, k): binomial(floor((2*n+1-k)/2), n-k) end:
    for n from 0 to 11 do seq(A194005(n, k), k=0..n) od;
    seq(seq(A194005(n,k), k=0..n), n=0..11);
    nmax:=11: for n from 0 to nmax+1 do b(n):=1 od:
    A103631 := proc(n,k) option remember: local j: if k=0 and n=0 then b(1)
    elif k=0 and n>=1 then 0 elif k=1 then b(n+1) elif k=2 then b(1)*b(n+1)
    elif k>=3 then expand(b(n+1)*add(procname(j,k-2), j=k-2..n-2)) fi: end:
    for n from 0 to nmax do for k from 0 to n do
    A194005(n,k):= add(A103631(n1,k), n1=k..n) od: od:
    seq(seq(A194005(n,k),k=0..n), n=0..nmax);
  • Mathematica
    Flatten[Table[Binomial[Floor[(2n+1-k)/2],n-k],{n,0,20},{k,0,n}]] (* Harvey P. Dale, Apr 15 2012 *)

Formula

T(n,k) = binomial(floor((2*n+1-k)/2), n-k).
T(n,k) = sum(A103631(n1,k), n1=k..n), 0<=k<=n and n>=0.
T(n,k) = sum(binomial(floor((2*n1-k-1)/2), n1-k), n1=k..n).
T(n,0) = T(n,n) = 1, T(n,k) = T(n-2,k-2) + T(n-1,k), 0 < k < n. - Reinhard Zumkeller, Nov 23 2012

A304326 Number of ways to write n as a product of a number that is not a perfect power and a squarefree number.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 0, 1, 3, 1, 3, 1, 3, 3, 0, 1, 3, 1, 3, 3, 3, 1, 2, 1, 3, 0, 3, 1, 7, 1, 0, 3, 3, 3, 3, 1, 3, 3, 2, 1, 7, 1, 3, 3, 3, 1, 2, 1, 3, 3, 3, 1, 2, 3, 2, 3, 3, 1, 7, 1, 3, 3, 0, 3, 7, 1, 3, 3, 7, 1, 3, 1, 3, 3, 3, 3, 7, 1, 2, 0, 3, 1, 7, 3, 3, 3, 2, 1
Offset: 1

Views

Author

Gus Wiseman, May 10 2018

Keywords

Examples

			The a(180) = 7 ways are (6*30), (12*15), (18*10), (30*6), (60*3), (90*2), (180*1).
		

Crossrefs

Positions of zeros are A246549. Range appears to be A075427.

Programs

  • Mathematica
    radQ[n_]:=And[n>1,GCD@@FactorInteger[n][[All,2]]===1];
    Table[Length[Select[Divisors[n],radQ[#]&&SquareFreeQ[n/#]&]],{n,100}]
  • PARI
    a(n)={sumdiv(n, d, d<>1 && !ispower(d) && issquarefree(n/d))} \\ Andrew Howroyd, Aug 26 2018

A094024 Alternating 1 with one less than the powers of 2.

Original entry on oeis.org

1, 1, 1, 3, 1, 7, 1, 15, 1, 31, 1, 63, 1, 127, 1, 255, 1, 511, 1, 1023, 1, 2047, 1, 4095, 1, 8191, 1, 16383, 1, 32767, 1, 65535, 1, 131071, 1, 262143, 1, 524287, 1, 1048575, 1, 2097151, 1, 4194303, 1, 8388607, 1, 16777215, 1, 33554431, 1, 67108863, 1
Offset: 0

Views

Author

Paul Barry, Apr 22 2004

Keywords

Comments

Inverse binomial transform of A052542. Partial sums are A075427.
Let F(x) = product {n >= 0} (1 - x^(3*n+1))/(1 - x^(3*n+2)). This sequence is the simple continued fraction expansion of the real number F(1/2) = 0.64227 25013 85234 96714 ... = 1/(1 + 1/(1 + 1/(1 + 1/(3 + 1/(1 + 1/(7 + 1/(1 + 1/(15 + ...)))))))). See A111317. - Peter Bala, Dec 26 2012

Crossrefs

Programs

  • Magma
    [Ceiling((-1)^n+((Sqrt(2))^n-(-Sqrt(2))^n)/Sqrt(2)): n in [0..50]]; // Vincenzo Librandi, Aug 17 2011
    
  • Mathematica
    LinearRecurrence[{-1, 2, 2}, {1, 1, 1}, 60] (* Jean-François Alcover, Jul 02 2018 *)
  • PARI
    a(n)=(1-(-1)^n)*2^floor(n/2)+(-1)^n

Formula

G.f.: (1+2*x) / ((1+x) * (1-2*x^2)).
E.g.f.: exp(-x) + 2*sinh(sqrt(2)*x) / sqrt(2).
a(n) = (-1)^n + ((sqrt(2))^n - (-sqrt(2))^n) / sqrt(2).
a(n) = (1-(-1)^n) * 2^floor(n/2) + (-1)^n. - Ralf Stephan, Aug 19 2013
a(n) = -a(n-1) + 2*a(n-2) + 2*a(n-3). - Andrew Howroyd, Feb 21 2018

Extensions

Better name from Ralf Stephan, Aug 19 2013
Even terms for n >= 60 corrected in b-file by Andrew Howroyd, Feb 21 2018

A180201 Inverse permutation to A180200.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

A180199(n) = a(a(n));
a(A180198(n)) = A180198(a(n)) = A180200(n);
a(A075427(n)) = A075427(n).
This permutation transforms the enumeration system of positive irreducible fractions A245325/A245326 into the enumeration system A007305/A047679 (Stern-Brocot), and enumeration system A071766/A229742 (HCS) into A162909/A162910 (Bird). - Yosu Yurramendi, Jun 09 2015

Programs

  • R
    #
    maxn <- 63 # by choice
    a <- 1
    for(n in 1:maxn){
    a[2*n  ] <- 2*a[n] + (n%%2 == 0)
    a[2*n+1] <- 2*a[n] + (n%%2 != 0)}
    a <- c(0, a)
    # Yosu Yurramendi, May 23 2020

Formula

a(n) = A233280(A258746(n)) = A117120(A233280(n)), n > 0. - Yosu Yurramendi, Apr 10 2017 [Corrected by Yosu Yurramendi, Mar 14 2025]
a(0) = 0, a(1) = 1, for n > 0 a(2*n) = 2*a(n) + [n even], a(2*n + 1) = 2*a(n) + [n odd]. - Yosu Yurramendi, May 23 2020
From Alan Michael Gómez Calderón, Mar 04 2025: (Start)
a(n) = A054429(n) XOR floor(n/2) for n > 0.
a(n) = A054429(A003188(n)) for n > 0. (End)
a(n) = A154436(A054429(n)), n > 0. - Yosu Yurramendi, Mar 11 2025

A080610 Partial sums of Jacobsthal gap sequence.

Original entry on oeis.org

0, 1, 4, 5, 20, 21, 84, 85, 340, 341, 1364, 1365, 5460, 5461, 21844, 21845, 87380, 87381, 349524, 349525, 1398100, 1398101, 5592404, 5592405, 22369620, 22369621, 89478484, 89478485, 357913940, 357913941, 1431655764, 1431655765, 5726623060
Offset: 0

Views

Author

Paul Barry, Feb 26 2003

Keywords

Crossrefs

Programs

  • Magma
    [2^n+(-2)^n/3-(-1)^n/2-5/6: n in [0..30]]; // Vincenzo Librandi, Aug 05 2013
  • Mathematica
    CoefficientList[Series[x (1 + 4 x) / ((1 - x^2) (1 - 4 x^2)), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 05 2013 *)
    LinearRecurrence[{0,5,0,-4},{0,1,4,5},40] (* Harvey P. Dale, Nov 11 2021 *)

Formula

a(2n-1) = A001045(2n) = A002450(n); a(2n) = A001045(2n) - 1 = A002450(n) - 1.
G.f.: x*(1+4*x)/((1-x^2)*(1-4x^2)). - Ralf Stephan, Sep 16 2003
a(n) = 2^n+(-2)^n/3-(-1)^n/2-5/6. - Paul Barry, Apr 22 2004
a(n) = a(n-1)*4 if n even; a(n) = a(n-1)+1 if n odd. - Philippe Deléham, Apr 22 2013

A097162 a(n) = Sum_{k=0..n} C(floor((n+1)/2),floor((k+1)/2))*2^k.

Original entry on oeis.org

1, 3, 7, 21, 37, 123, 187, 681, 937, 3663, 4687, 19341, 23437, 100803, 117187, 520401, 585937, 2667543, 2929687, 13599861, 14648437, 69047883, 73242187, 349433721, 366210937, 1763945823, 1831054687, 8886837981, 9155273437, 44702625363
Offset: 0

Views

Author

Paul Barry, Jul 30 2004

Keywords

Crossrefs

Programs

  • Maple
    A097162:=n->add(binomial(floor((n+1)/2),floor((k+1)/2))*2^k, k=0..n): seq(A097162(n), n=0..30); # Wesley Ivan Hurt, Sep 18 2014
  • Mathematica
    LinearRecurrence[{1,9,-9,-20,20},{1,3,7,21,37},50] (* Vincenzo Librandi, Jan 30 2012 *)

Formula

G.f.: (1+2*x-5*x^2-4*x^3)/((1-x)*(1-4*x^2)*(1-5*x^2)).
a(n) = (3/4-3*sqrt(5)/4)*(-sqrt(5))^n +(3/4+3*sqrt(5)/4)*(sqrt(5))^n-(2^n-(-2)^n)-1/2.
a(2*n) = A057651(n); a(2*n+1)=3*A097165(n).
a(n+5) = 20*a(n)-20*a(n+1)-9*a(n+2)+9*a(n+3)+a(n+4). - Robert Israel, Sep 18 2014

A180198 a(n) = A180200(A180200(n)).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

Permutation of the natural numbers with inverse A180199;
a(A180201(n)) = A180201(a(n)) = A180200(n);
a(A075427(n)) = A075427(n).

Crossrefs

A180199 a(n) = A180201(A180201(n)).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

Permutation of the natural numbers with inverse A180198;
a(A180200(n)) = A180200(a(n)) = A180201(n);
a(A075427(n)) = A075427(n).

Programs

  • R
    nmax <- 31 # by choice
    a <- 1:3
    for(n in 1:nmax) for(k in 0:3){
    if(n %% 2 == 0) a[4*n + k] <- 2*a[2*n + (k == 2 | k == 3)] + (k == 0 | k == 2)
    else            a[4*n + k] <- 2*a[2*n + (k == 2 | k == 3)] + (k == 1 | k == 3)
    }
    (a <- c(0,a))
    # Yosu Yurramendi, Oct 25 2020

A075426 Smallest initial value k that reaches 1 in n steps when iterating the map m -> rad(m)-1, where rad(m) is the squarefree kernel of m (A007947).

Original entry on oeis.org

1, 2, 3, 6, 7, 14, 15, 30, 31, 62, 95, 318, 319, 734, 959, 2798, 2879, 5758, 5759, 11518, 11519, 23038, 23039, 46078, 46079, 92158, 92159, 184318, 184319, 368638, 368639, 737278, 737279, 1548286, 1548287, 3096574, 5160959, 10321918, 10321919
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 15 2002

Keywords

Comments

Least k such that A075425(k) = n;
Observations: a(n) = n mod 2; frequently a(2k)+1 = a(2k+1) and a(2k) = 2*a(2k-1). a(n)=A075427(n-1) for n<=9.
Also A110157(a(n)) = n and A110157(m) < n for m < a(n).

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a075426 = (+ 1) . fromJust . (`elemIndex` a075425_list)
    -- Reinhard Zumkeller, Aug 14 2013
  • PARI
    rad(n)=my(f=factor(n)[, 1]); prod(i=1, #f, f[i])
    A075425(n)=if(n<4, n, 1+A075425(rad(n)-1))
    r=0;for(n=1,1e8,t=A075425(n);if(t>r,r=t;print1(n", "))) \\ Charles R Greathouse IV, Aug 08 2013
    

Extensions

a(33)-a(38) from Donovan Johnson, Aug 27 2010
Showing 1-10 of 22 results. Next