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 21-30 of 77 results. Next

A338062 Numbers k such that the Enots Wolley sequence A336957(k) is odd.

Original entry on oeis.org

1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29, 32, 33, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 68, 69, 72, 73, 76, 77, 80, 81, 84, 85, 88, 89, 92, 93, 96, 97, 100, 101, 104, 105, 108, 109, 112, 113, 116, 117, 120, 121, 124, 125, 128, 129, 132, 133, 136, 137
Offset: 1

Views

Author

N. J. A. Sloane, Oct 18 2020

Keywords

Comments

a(n) = A042948(n) for n<=1065, but then the two sequences start to differ. - R. J. Mathar, Nov 06 2020

Crossrefs

Programs

  • Mathematica
    M = 1000;
    A[1] = 1; A[2] = 2;
    Clear[B]; B[_] = 0;
    For[n = 3, True, n++, For[k = 3, k <= M, k++, If[B[k] == 0 && GCD[k, A[n-1]] > 1 && GCD[k, A[n-2]] == 1, If[Length[FactorInteger[k][[All, 1]] ~Complement~ FactorInteger[A[n-1]][[All, 1]]] > 0, A[n] = k; B[k] = 1; Break[]]]]; If[k > M, Break[]]];
    Reap[For[k = 1, k <= M, k++, If[OddQ[A[k]], Sow[k]]]][[2, 1]] (* Jean-François Alcover, Oct 23 2020, after Maple code in A336957 *)

A052951 Expansion of (1 + x - 2*x^2)/(1 - 2*x)^2.

Original entry on oeis.org

1, 5, 14, 36, 88, 208, 480, 1088, 2432, 5376, 11776, 25600, 55296, 118784, 253952, 540672, 1146880, 2424832, 5111808, 10747904, 22544384, 47185920, 98566144, 205520896, 427819008, 889192448, 1845493760, 3825205248, 7918845952
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Equals binomial transform of A042948 starting with "1": (1, 4, 5, 8, 9, 12, 13, ...) = terms > 0, == 0 or 1 mod 4. - Gary W. Adamson, Feb 07 2009

Crossrefs

Programs

  • GAP
    Concatenation([1], List([1..40], n-> 2^(n-1)*(2*n+3) )); # G. C. Greubel, Oct 21 2019
  • Magma
    I:=[1, 5, 14]; [n le 3 select I[n] else 4*Self(n-1)-4*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Jun 22 2012
    
  • Maple
    spec:= [S,{S=Prod(Union(Sequence(Union(Z,Z)),Z),Sequence(Union(Z,Z)))}, unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    seq(`if`(n=0, 1, 2^(n-1)*(2*n+3)), n=0..40); # G. C. Greubel, Oct 21 2019
  • Mathematica
    CoefficientList[Series[(1+x-2*x^2)/(1-2*x)^2,{x,0,40}],x] (* Vincenzo Librandi, Jun 22 2012 *)
    LinearRecurrence[{4,-4}, {1,5,14}, 40] (* G. C. Greubel, Oct 21 2019 *)
  • PARI
    x='x+O('x^40); Vec((1+x-2*x^2)/(1-2*x)^2) \\ Altug Alkan, Mar 03 2018
    
  • Sage
    [1]+[2^(n-1)*(2*n+3) for n in (1..40)] # G. C. Greubel, Oct 21 2019
    

Formula

G.f.: (1+x-2*x^2)/(1-2*x)^2.
a(n) = 4*(a(n-1) - a(n-2)).
a(n) = (n+1)*2^n + 2^(n-1), n > 0.
a(n) = A118413(n+1,n-1) for n > 2. - Reinhard Zumkeller, Apr 27 2006
E.g.f.: (1/2)*(-1 + exp(2*x)*(3 + 4*x)). - Stefano Spezia, Oct 22 2019
From Amiram Eldar, Oct 01 2022: (Start)
Sum_{n>=0} 1/a(n) = 4*sqrt(2)*arcsinh(1) - 11/3.
Sum_{n>=0} (-1)^n/a(n) = 13/3 - 4*sqrt(2)*arccot(sqrt(2)). (End)

A266180 Decimal representation of the n-th iteration of the "Rule 6" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 6, 16, 96, 256, 1536, 4096, 24576, 65536, 393216, 1048576, 6291456, 16777216, 100663296, 268435456, 1610612736, 4294967296, 25769803776, 68719476736, 412316860416, 1099511627776, 6597069766656, 17592186044416, 105553116266496, 281474976710656
Offset: 0

Views

Author

Robert Price, Dec 22 2015

Keywords

Comments

A001025 is a subsequence. - Altug Alkan, Dec 23 2015
Rules 38, 134 and 166 also generate this sequence.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Programs

  • Mathematica
    rule=6; rows=20; ca=CellularAutomaton[rule,{{1},0},rows-1,{All,All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]],{rows-k+1,rows+k-1}],{k,1,rows}]; (* Truncated list of each row *) Table[FromDigits[catri[[k]],2],{k,1,rows}]   (* Decimal Representation of Rows *)
    LinearRecurrence[{0,16},{1,6},30] (* Harvey P. Dale, May 25 2016 *)
  • Python
    print([int(4**(n-1)*(5-(-1)**n)) for n in range(30)]) # Karl V. Keller, Jr., Jun 03 2021

Formula

From Colin Barker, Dec 23 2015 and Apr 13 2019: (Start)
a(n) = 4^(n-1)*(5-(-1)^n).
a(n) = 16*a(n-2) for n>1.
G.f.: (1+6*x) / ((1-4*x)*(1+4*x)).
(End)

A361236 Array read by antidiagonals: T(n,k) is the number of noncrossing k-gonal cacti with n polygons up to rotation.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 5, 11, 1, 1, 1, 1, 8, 33, 49, 1, 1, 1, 1, 9, 63, 230, 204, 1, 1, 1, 1, 12, 105, 664, 1827, 984, 1, 1, 1, 1, 13, 159, 1419, 7462, 15466, 4807, 1, 1, 1, 1, 16, 221, 2637, 21085, 90896, 137085, 24739, 1
Offset: 0

Views

Author

Andrew Howroyd, Mar 05 2023

Keywords

Comments

The number of noncrossing k-gonal cacti is given by column 2*(k-1) of A070914. This sequence enumerates these cacti with rotations being considered equivalent.
Equivalently, T(n,k) is the number of connected acyclic k-uniform noncrossing antichains with n blocks covering (k-1)*n+1 nodes where the intersection of two blocks is at most 1 node modulo cyclic rotation of the nodes.
Noncrossing trees correspond to the case of k = 2.

Examples

			=====================================================
n\k | 1     2       3        4        5         6 ...
----+------------------------------------------------
  0 | 1     1       1        1        1         1 ...
  1 | 1     1       1        1        1         1 ...
  2 | 1     1       1        1        1         1 ...
  3 | 1     4       5        8        9        12 ...
  4 | 1    11      33       63      105       159 ...
  5 | 1    49     230      664     1419      2637 ...
  6 | 1   204    1827     7462    21085     48048 ...
  7 | 1   984   15466    90896   334707    941100 ...
  8 | 1  4807  137085  1159587  5579961  19354687 ...
  9 | 1 24739 1260545 15369761 96589350 413533260 ...
  ...
		

Crossrefs

Columns k=1..4 are A000012, A296532, A361237, A361238.
Row n=3 is A042948.

Programs

  • PARI
    \\ here u is Fuss-Catalan sequence with p = 2*k-1.
    u(n,k,r) = {r*binomial(n*(2*k-1) + r, n)/(n*(2*k-1) + r)}
    T(n,k) = if(n==0, 1, u(n, k, 1)/((k-1)*n+1) + sumdiv(gcd(k,n-1), d, if(d>1, eulerphi(d)*u((n-1)/d, k, 2*k/d)/k)))

Formula

T(0,k) = T(1,k) = T(2,k) = 1.

A047624 Numbers that are congruent to {0, 1, 3, 5} mod 8.

Original entry on oeis.org

0, 1, 3, 5, 8, 9, 11, 13, 16, 17, 19, 21, 24, 25, 27, 29, 32, 33, 35, 37, 40, 41, 43, 45, 48, 49, 51, 53, 56, 57, 59, 61, 64, 65, 67, 69, 72, 73, 75, 77, 80, 81, 83, 85, 88, 89, 91, 93, 96, 97, 99, 101, 104, 105, 107, 109, 112, 113, 115, 117, 120, 121, 123
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n : n in [0..150] | n mod 8 in [0, 1, 3, 5]]; // Wesley Ivan Hurt, Jun 01 2016
  • Maple
    A047624:=n->(8*n-11-I^(2*n)+I^(1-n)-I^(1+n))/4: seq(A047624(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
  • Mathematica
    Table[(8n-11-I^(2n)+I^(1-n)-I^(1+n))/4, {n, 80}] (* Wesley Ivan Hurt, Jun 01 2016 *)
    LinearRecurrence[{1,0,0,1,-1},{0,1,3,5,8},100] (* G. C. Greubel, Jun 01 2016 *)

Formula

From Reinhard Zumkeller, Feb 21 2010: (Start)
a(n+1) = A173562(n) - A173562(n-1);
a(n+1) - a(n) = A140081(n-1) + 1;
a(n) = A140201(n-1) + A042948(A004526(n-1)). (End)
G.f.: x^2*(1+2*x+2*x^2+3*x^3) / ( (1+x)*(x^2+1)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, Jun 01 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (8*n-11-i^(2*n)+i^(1-n)-i^(1+n))/4 where i=sqrt(-1).
a(2k) = A016813(k-1) for k>0, a(2k-1) = A047470(k). (End)
E.g.f.: (6 + sin(x) + (4*x - 5)*sinh(x) + (4*x - 6)*cosh(x))/2. - Ilya Gutkovskiy, Jun 01 2016
Sum_{n>=2} (-1)^n/a(n) = (3-sqrt(2))*Pi/16 + (8-sqrt(2))*log(2)/16 + sqrt(2)*log(2+sqrt(2))/8. - Amiram Eldar, Dec 20 2021

A140201 Partial sums of A140081.

Original entry on oeis.org

0, 1, 2, 4, 4, 5, 6, 8, 8, 9, 10, 12, 12, 13, 14, 16, 16, 17, 18, 20, 20, 21, 22, 24, 24, 25, 26, 28, 28, 29, 30, 32, 32, 33, 34, 36, 36, 37, 38, 40, 40, 41, 42, 44, 44, 45, 46, 48, 48, 49, 50, 52, 52, 53, 54, 56, 56, 57, 58, 60, 60, 61, 62, 64, 64, 65, 66, 68, 68, 69, 70, 72, 72, 73, 74
Offset: 0

Views

Author

Nadia Heninger and N. J. A. Sloane, Jun 09 2008

Keywords

Crossrefs

Programs

  • Magma
    I:=[0, 1, 2, 4, 4]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..80]]; // Vincenzo Librandi, Sep 17 2012
  • Maple
    A140201:=n->(4*n+1-I^(2*n)+(-I)^(1+n)+I^(1+n))/4: seq(A140201(n), n=0..100); # Wesley Ivan Hurt, Jun 04 2016
  • Mathematica
    Accumulate[PadRight[{}, 68, {0, 1, 1, 2}]] (* Harvey P. Dale, Aug 19 2011 *)

Formula

a(n) = A047624(n+1) - A042948(A004526(n)). - Reinhard Zumkeller, Feb 21 2010
a(n) = A002265(n+1) + A057353(n+1). - Reinhard Zumkeller, Feb 26 2011
From Bruno Berselli, Jan 27 2011: (Start)
G.f.: x*(1+x+2*x^2)/((1+x)*(1+x^2)*(1-x)^2).
a(n) = a(n-1) + a(n-4) - a(n-5) for n>4.
a(n) = n + A121262(n+1). (End)
a(n) = n when n+1 is not a multiple of 4, and a(n) = n+1 when n+1 is a multiple of 4. - Dennis P. Walsh, Aug 06 2012
a(n) = A004524(n+1) + A004526(n+1). - Arkadiusz Wesolowski, Sep 17 2012
a(n) = (4*n+1-i^(2*n)+(-i)^(1+n)+i^(1+n))/4 where i=sqrt(-1). - Wesley Ivan Hurt, Jun 04 2016
a(n) = n+1-(sign((n+1) mod 4) mod 3). - Wesley Ivan Hurt, Sep 26 2017

A201630 a(n) = a(n-1) + 2*a(n-2) with n>1, a(0)=2, a(1)=7.

Original entry on oeis.org

2, 7, 11, 25, 47, 97, 191, 385, 767, 1537, 3071, 6145, 12287, 24577, 49151, 98305, 196607, 393217, 786431, 1572865, 3145727, 6291457, 12582911, 25165825, 50331647, 100663297, 201326591, 402653185, 805306367, 1610612737, 3221225471, 6442450945, 12884901887
Offset: 0

Views

Author

Bruno Berselli, Dec 03 2011

Keywords

References

  • B. Satyanarayana and K. S. Prasad, Discrete Mathematics and Graph Theory, PHI Learning Pvt. Ltd. (Eastern Economy Edition), 2009, p. 73 (problem 3.3).

Crossrefs

Programs

  • Magma
    [n le 2 select 5*n-3 else Self(n-1)+2*Self(n-2): n in [1..33]];
    
  • Mathematica
    LinearRecurrence[{1, 2}, {2,7}, 33]
  • Maxima
    a[0]:2$ a[1]:7$ a[n]:=a[n-1]+2*a[n-2]$ makelist(a[n], n, 0, 32);
    
  • PARI
    v=vector(33); v[1]=2; v[2]=7; for(i=3, #v, v[i]=v[i-1]+2*v[i-2]); v
    
  • SageMath
    def A201630(n): return 3*2**n - (-1)**n
    print([A201630(n) for n in range(31)]) # G. C. Greubel, Feb 07 2025

Formula

G.f.: (2+5*x)/((1+x)*(1-2*x)).
a(n) = 3*2^n - (-1)^n.
a(n) = 7 + 2*Sum_{i=0..n-2} a(i), for n>0.
a(n) = A097581(A042948(n+1)).
a(n+2) - a(n) = a(n+1) + a(n) = A005010(n).
E.g.f.: 3*exp(2*x) - exp(-x). - G. C. Greubel, Feb 07 2025

A090964 Permutation of natural numbers generated by 2-rowed array shown below.

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Feb 29 2004

Keywords

Comments

1 4 5 8 9 12 13 16 17 20...(A042948)
2 3 6 7 10 11 14 15 18 19...(A042964)

Formula

For n > 1, a(n+8) = a(n)+8. - David Wasserman, Feb 23 2006

Extensions

More terms from David Wasserman, Feb 23 2006

A133907 Least prime number p such that binomial(n+p, p) mod p = 1.

Original entry on oeis.org

2, 3, 5, 2, 2, 7, 11, 2, 2, 3, 3, 2, 2, 17, 17, 2, 2, 3, 3, 2, 2, 23, 29, 2, 2, 5, 3, 2, 2, 31, 37, 2, 2, 37, 37, 2, 2, 3, 41, 2, 2, 43, 47, 2, 2, 3, 3, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 59, 61, 2, 2, 67, 3, 2, 2, 67, 71, 2, 2, 71, 73, 2, 2, 3, 5, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 89, 89, 2, 2, 3, 3, 2, 2, 97
Offset: 1

Views

Author

Hieronymus Fischer, Oct 20 2007

Keywords

Comments

Also the least prime number p such that p divides floor(n/p) or p > n.
a(n) = 2 if and only if n is in A042948. - Robert Israel, May 11 2017
Conjecture: a(n) is the smallest prime p such that Sum_{k=1..n} k^(p-1) == n (mod p). Thus a(n) >= A317358(n). - Thomas Ordowski, Jul 29 2018

Examples

			a(2)=3, since binomial(2+3,3) mod 3 = 10 mod 3 = 1 and 3 is the minimal prime number with this property.
a(7)=11 because of binomial(7+11, 11) = 31824 = 2893*11 + 1, but binomial(7+k, k) mod k <> 1 for all primes < 11.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m;
      m:= 2:
      while floor(n/m) mod m <> 0 do m:= nextprime(m) od:
      m
    end proc:
    map(f, [$1..100]); # Robert Israel, May 11 2017
  • Mathematica
    a[n_] := Module[{p}, For[p = 2, True, p = NextPrime[p], If[Mod[Binomial[n+p, p], p] == 1, Return[p]]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 05 2023 *)
  • PARI
    a(n) = my(p=2); while (binomial(n+p, p) % p != 1, p = nextprime(p+1)); p; \\ Michel Marcus, Dec 17 2022
    
  • Python
    from sympy import nextprime, ff
    def A133907(n):
        p, m = 2, (n+2)*(n+1)>>1
        while m%p != 1:
            q = nextprime(p)
            m = m*ff(n+q,q-p)//ff(q,q-p)
            p = q
        return p # Chai Wah Wu, Feb 22 2023

A140685 Triangle T(n,k) read by rows: T(n,k) = 1 if n is odd and k=(n-1)/2; T(n,k) = 2 otherwise.

Original entry on oeis.org

1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Roger L. Bagula and Mats Granvik, Jul 11 2008

Keywords

Comments

Row sums give A042948.

Examples

			The triangle starts in row n=1 with columns 0 <= k < n as:
  1;
  2, 2;
  2, 1, 2;
  2, 2, 2, 2;
  2, 2, 1, 2, 2;
  2, 2, 2, 2, 2, 2;
  2, 2, 2, 1, 2, 2, 2;
  2, 2, 2, 2, 2, 2, 2, 2;
  2, 2, 2, 2, 1, 2, 2, 2, 2;
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2;
		

Crossrefs

Programs

Extensions

Definition simplified by the Assoc. Eds. of the OEIS, Oct 12 2010
More terms from Antti Karttunen, Oct 10 2017
Previous Showing 21-30 of 77 results. Next