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 31-40 of 135 results. Next

A278043 Number of 1's in tribonacci representation of n (cf. A278038).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 2, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 4, 1, 2, 2, 3, 2, 3, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 3, 4, 4, 5, 4, 5, 1, 2, 2, 3, 2, 3, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4
Offset: 0

Views

Author

N. J. A. Sloane, Nov 18 2016

Keywords

Crossrefs

Programs

  • Mathematica
    t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; a[0] = 0; a[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; DigitCount[Total[2^(s - 1)], 2, 1]]; Array[a, 100, 0] (* Amiram Eldar, Mar 04 2022 *)

Formula

a(n) = A000120(A003726(n+1)). - John Keith, May 23 2022

A047080 Triangular array T read by rows: T(h,k)=number of paths from (0,0) to (k,h-k) using step-vectors (0,1), (1,0), (1,1) with no right angles between pairs of consecutive steps.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 3, 1, 1, 4, 5, 5, 4, 1, 1, 5, 8, 9, 8, 5, 1, 1, 6, 12, 15, 15, 12, 6, 1, 1, 7, 17, 24, 27, 24, 17, 7, 1, 1, 8, 23, 37, 46, 46, 37, 23, 8, 1, 1, 9, 30, 55, 75, 83, 75, 55, 30, 9, 1, 1, 10, 38, 79, 118, 143, 143, 118, 79, 38, 10, 1
Offset: 0

Views

Author

Keywords

Comments

T(n,k) equals the number of reduced alignments between a string of length n and a string of length k. See Andrade et. al. - Peter Bala, Feb 04 2018

Examples

			E.g., row 3 consists of T(3,0)=1; T(3,1)=2; T(3,2)=2; T(3,3)=1.
Triangle begins:
  1;
  1,  1;
  1,  1,  1;
  1,  2,  2,  1;
  1,  3,  3,  3,  1;
  1,  4,  5,  5,  4,  1;
  1,  5,  8,  9,  8,  5,  1;
  1,  6, 12, 15, 15, 12,  6,  1;
		

Crossrefs

Programs

  • Magma
    F:=Factorial;
    p:= func< n,k | (&+[ (-1)^j*F(n+k-3*j)/(F(j)*F(n-2*j)*F(k-2*j)): j in [0..Min(Floor(n/2), Floor(k/2))]]) >;
    q:= func< n,k | n eq 0 or k eq 0 select 0 else (&+[ (-1)^j*F(n+k-3*j-2)/(F(j)*F(n-2*j-1)*F(k-2*j-1)) : j in [0..Min(Floor((n-1)/2), Floor((k-1)/2))]]) >;
    A:= func< n,k | p(n,k) - q(n,k) >;
    A047080:= func< n,k | n eq 0 select 1 else A(n-k, k) >;
    [[A(n,k): k in [1..6]]: n in [1..6]];
    [A047080(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Oct 30 2022
    
  • Maple
    T := proc(n, k) option remember; if n < 0 or k > n then return 0 fi;
    if n < 3 then return 1 fi; if k < iquo(n,2) then return T(n, n-k) fi;
    T(n-1, k-1) + T(n-1, k) - T(n-4, k-2)  end:
    seq(seq(T(n,k), k=0..n), n=0..11); # Peter Luschny, Feb 11 2018
  • Mathematica
    T[n_, k_] := T[n, k] = Which[n<0 || k>n, 0, n<3, 1, kJean-François Alcover, Jul 30 2018 *)
  • SageMath
    f=factorial
    def p(n,k): return sum( (-1)^j*f(n+k-3*j)/(f(j)*f(n-2*j)*f(k-2*j)) for j in range(1+min((n//2), (k//2))) )
    def q(n,k): return sum( (-1)^j*f(n+k-3*j-2)/(f(j)*f(n-2*j-1)*f(k-2*j-1)) for j in range(1+min(((n-1)//2), ((k-1)//2))) )
    def A(n,k): return p(n,k) - q(n,k)
    def A047080(n,k): return A(n-k, k)
    flatten([[A047080(n,k) for k in range(n+1)] for n in range(14)]) # G. C. Greubel, Oct 30 2022

Formula

T(h, k) = T(h-1, k-1) + T(h-1, k) - T(h-4, k-2);
Writing T(h, k) = F(h-k, k), generating function for F is (1-xy)/(1-x-y+x^2y^2).
From Peter Bala, Feb 04 2018: (Start)
T(n, k) = (Sum_{i = 0..A} (-1)^i*(n+k-3*i)!/(i!*(n-2*i)!*(k-2*i)!)) - (Sum_{i = 0..B} (-1)^i*(n+k-3*i-2)!/(i!*(n-2*i-1)!*(k-2*i-1)!)), where A = min{floor(n/2), floor(k/2)} and B = min{floor((n-1)/2), floor((k-1)/2)}.
T(2*n, n) = A171155(n). (End)
From G. C. Greubel, Oct 30 2022: (Start) (formulas for triangle T(n,k))
T(n, n-k) = T(n, k).
T(n, n) = A000012(n).
T(n, n-1) = A028310(n-1).
T(n, n-2) = A089071(n-1) = A022856(n+1).
T(2*n, n-1) = A047087(n).
T(2*n+1, n-1) = A047088(n).
Sum_{k=0..n} T(n, k) = (-1)^n*A078042(n) = A001590(n+3).
Sum_{k=0..n} (-1)^k*T(n, k) = A091337(n+1).
Sum_{k=0..floor(n/2)} T(n, k) = A047084(n). (End)

Extensions

Sequence recomputed to correct terms from 23rd onward, and recurrence and generating function added by Michael L. Catalano-Johnson (mcj(AT)pa.wagner.com), Jan 14 2000

A047081 a(n) = Sum_{k=0..n} T(n, k), array T as in A047080.

Original entry on oeis.org

1, 2, 3, 6, 11, 20, 37, 68, 125, 230, 423, 778, 1431, 2632, 4841, 8904, 16377, 30122, 55403, 101902, 187427, 344732, 634061, 1166220, 2145013, 3945294, 7256527, 13346834, 24548655, 45152016, 83047505, 152748176, 280947697, 516743378, 950439251, 1748130326, 3215312955, 5913882532, 10877325813
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n le 3 select n else Self(n-1) +Self(n-2) +Self(n-3): n in [1..60]]; // G. C. Greubel, Oct 31 2022
    
  • Mathematica
    LinearRecurrence[{1,1,1}, {1,2,3}, 61] (* G. C. Greubel, Oct 31 2022 *)
  • SageMath
    @CachedFunction
    def a(n): return (n+1) if (n<3) else a(n-1) +a(n-2) +a(n-3) # a = A047081
    [a(n) for n in (0..60)] # G. C. Greubel, Oct 31 2022

Formula

From G. C. Greubel, Oct 31 2022: (Start)
G.f.: (1 + x)/(1 - x - x^2 - x^3).
a(n) = A000073(n+1) + A000073(n+2). (End)
a(n) = Sum_{r root of x^3-x^2-x-1} r^n/(-3*r^2+5*r+2). - Fabian Pereyra, Nov 23 2024
a(n) = A001590(n+3). - R. J. Mathar, Mar 28 2025

Extensions

Data corrected by G. C. Greubel, Oct 31 2022

A089068 a(n) = a(n-1)+a(n-2)+a(n-3)+2 with a(0)=0, a(1)=0 and a(2)=1.

Original entry on oeis.org

0, 0, 1, 3, 6, 12, 23, 43, 80, 148, 273, 503, 926, 1704, 3135, 5767, 10608, 19512, 35889, 66011, 121414, 223316, 410743, 755475, 1389536, 2555756, 4700769, 8646063, 15902590, 29249424, 53798079, 98950095, 181997600, 334745776, 615693473
Offset: 0

Views

Author

Roger L. Bagula, Dec 03 2003

Keywords

Comments

The a(n+2) represent the Kn12 and Kn22 sums of the square array of Delannoy numbers A008288. See A180662 for the definition of these knight and other chess sums. - Johannes W. Meijer, Sep 21 2010

Crossrefs

Cf. A000073 (Kn11 & Kn21), A089068 (Kn12 & Kn22), A180668 (Kn13 & Kn23), A180669 (Kn14 & Kn24), A180670 (Kn15 & Kn25). - Johannes W. Meijer, Sep 21 2010

Programs

  • Mathematica
    Join[{a=0,b=0,c=1},Table[d=a+b+c+2;a=b;b=c;c=d,{n,50}]] (* Vladimir Joseph Stephan Orlovsky, Apr 19 2011 *)
    RecurrenceTable[{a[0]==a[1]==0,a[2]==1,a[n]==a[n-1]+a[n-2]+a[n-3]+2}, a[n],{n,40}] (* or *) LinearRecurrence[{2,0,0,-1},{0,0,1,3},40] (* Harvey P. Dale, Sep 19 2011 *)

Formula

a(n) = A008937(n-2)+A008937(n-1). - Johannes W. Meijer, Sep 21 2010
a(n) = A018921(n-5)+A018921(n-4), n>4. - Johannes W. Meijer, Sep 21 2010
a(n) = A000073(n+2)-1. - R. J. Mathar, Sep 22 2010
From Johannes W. Meijer, Sep 22 2010: (Start)
a(n) = a(n-1)+A001590(n+1).
a(n) = Sum_{m=0..n} A040000(m)*A000073(n-m).
a(n+2) = Sum_{k=0..floor(n/2)} A008288(n-k+1,k+1).
G.f. = x^2*(1+x)/((1-x)*(1-x-x^2-x^3)). (End)
a(n) = 2*a(n-1)-a(n-4), a(0)=0, a(1)=0, a(2)=1, a(3)=3. - Bruno Berselli, Sep 23 2010

Extensions

Corrected and information added by Johannes W. Meijer, Sep 22 2010, Oct 22 2010
Definition based on arbitrarily set floating-point precision removed by R. J. Mathar, Sep 30 2010

A247027 Indices of primes in the tetranacci sequence A001631.

Original entry on oeis.org

5, 7, 12, 19, 47, 97, 124, 244, 564, 1037, 12007, 13662, 180039
Offset: 1

Views

Author

Robert Price, Sep 09 2014

Keywords

Comments

a(14) > 2*10^5.

Crossrefs

Programs

  • Mathematica
    a={0,0,1,0}; For[n=4, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[4]]=sum]

A241660 Indices of primes in A001630.

Original entry on oeis.org

3, 4, 7, 19, 62, 94, 722, 5197, 5262, 6182, 14007, 21579, 35354, 75592
Offset: 1

Views

Author

Robert Price, Apr 26 2014

Keywords

Comments

a(15) > 2*10^5.

Crossrefs

Programs

  • Mathematica
    a={0,0,1,2}; Print[3]; For[n=4, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[4]]=sum]

Extensions

Prepended a(1)=3 and Mathematica program corrected by Robert Price, Sep 09 2014

A059832 A ternary tribonacci triangle: form the triangle as follows: start with 3 single values: 1, 2, 3. Each succeeding row is a concatenation of the previous 3 rows.

Original entry on oeis.org

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

Views

Author

Jason Earls, Feb 25 2001

Keywords

Comments

Alternatively, define a morphism f: 1 -> 2, 2 -> 3, 3 -> 1,2,3; let S(0)=1, S(k) = f(S(k-1)) for k>0; then sequence is the concatenation S(0) S(1) S(2) S(3) ...

Examples

			Rows 0, 1, 2, ..., 8, ... of the triangle are:
0, [1]
1, [2]
2, [3]
3, [1, 2, 3]
4, [2, 3, 1, 2, 3]
5, [3, 1, 2, 3, 2, 3, 1, 2, 3]
6, [1, 2, 3, 2, 3, 1, 2, 3, 3, 1, 2, 3, 2, 3, 1, 2, 3]
7, [2, 3, 1, 2, 3, 3, 1, 2, 3, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3, 1, 2, 3, 3, 1, 2, 3, 2, 3, 1, 2, 3]
8, [3, 1, 2, 3, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3, 1, 2, 3, 3, 1, 2, 3, 2, 3, 1, 2, 3, 2, 3, 1, 2, 3, 3, 1, 2, 3, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3, 1, 2, 3, 3, 1, 2, 3, 2, 3, 1, 2, 3]
...
		

References

  • C. Pickover, Wonders of Numbers, Oxford University Press, NY, 2001, p. 273.

Crossrefs

Cf. A059835. Row sums A001590, row lengths A000213.
Rows 0,3,6,9,12,... converge to A305389, rows 1,4,7,10,... converge to A305390, and rows 2,5,8,11,... converge to A305391.

Programs

  • Maple
    # To get successive rows of A059832
    S:=Array(0..100);
    S[0]:=[1];
    S[1]:=[2];
    S[2]:=[3];
    for n from 3 to 12 do
    S[n]:=[op(S[n-3]),op(S[n-2]), op(S[n-1])];
    lprint(S[n]);
    od: # N. J. A. Sloane, Jul 04 2018

Formula

a(n) = A059825(n) + 1. - Sean A. Irvine, Oct 11 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Feb 26 2001
Entry revised by N. J. A. Sloane, Jun 21 2018

A062544 a(n) = n plus sum of previous three terms.

Original entry on oeis.org

0, 1, 3, 7, 15, 30, 58, 110, 206, 383, 709, 1309, 2413, 4444, 8180, 15052, 27692, 50941, 93703, 172355, 317019, 583098, 1072494, 1972634, 3628250, 6673403, 12274313, 22575993, 41523737, 76374072, 140473832, 258371672, 475219608, 874065145, 1607656459, 2956941247
Offset: 0

Views

Author

Henry Bottomley, Jun 26 2001

Keywords

Comments

It appears that this is the number of nonempty subsets of {1,2,...,n} with no gap of length greater than 3 (a set S has a gap of length d if a and b are in S but no x with aA119407 for the corresponding problem for gaps of length 4. - John W. Layman, Nov 02 2011
a(n-3) is the number of compositions of n with no part divisible by 3 and an odd number of parts congruent to 4 or 5 modulo 6. See Moser & Whitney reference. a(2) = 3 counts (5), (4,1), and (1,4) among the compositions of 5. - Brian Hopkins, Sep 06 2019

Examples

			a(5) = 5 + 15 + 7 + 3 = 30.
x + 3*x^2 + 7*x^3 + 15*x^4 + 30*x^5 + 58*x^6 + 110*x^7 + 206*x^8 + 383*x^9 + ...
		

Crossrefs

n plus sum of all previous terms gives A000225, n plus sum of two previous terms gives A001924, n plus previous term gives A000217, n gives A001477.
Cf. A001590 and A325473.

Programs

  • Mathematica
    Join[{c=0},a=b=0;Table[z=b+a+c+n;a=b;b=c;c=z,{n,1,40}]] (* Vladimir Joseph Stephan Orlovsky, Apr 02 2011 *)
  • PARI
    { a=a1=a2=a3=0; for (n=0, 300, write("b062544.txt", n, " ", a+=n + a2 + a3); a3=a2; a2=a1; a1=a ) } \\ Harry J. Smith, Aug 08 2009
    
  • PARI
    {a(n) = if( n<0, n = -n; polcoeff( x^4 / ((1 - x) * (1 - 2*x^3 + x^4)) + x * O(x^n), n), polcoeff( x / ((1 - x) * (1 - 2*x + x^4)) + x * O(x^n), n))} /* Michael Somos, Dec 28 2012 */

Formula

a(n) = 3*a(n-1) - 2*a(n-2) - 1*a(n-4) + 1*a(n-5). - Joerg Arndt, Apr 02 2011
a(n) = n + a(n-1) + a(n-2) + a(n-3) =(A001590(n+4) - n - 3)/2.
G.f.: x / ((1 - x) * (1 - 2*x + x^4)). a(n) = 2*a(n-1) - a(n-4) + 1. - Michael Somos, Dec 28 2012
a(n) = A325473(n+3) - (n+3). - Brian Hopkins, Sep 06 2019

A243622 Indices of primes in A214829.

Original entry on oeis.org

1, 2, 4, 10, 11, 12, 13, 58, 63, 89, 132, 157, 426, 457, 506, 613, 1839, 1936, 2042, 2355, 3178, 3782, 8556, 8688, 22152, 23232, 44074, 71770, 222666
Offset: 1

Views

Author

Robert Price, Jun 07 2014

Keywords

Comments

a(30) > 222666.

Crossrefs

Programs

  • Mathematica
    a={1,7,7}; Print["1"]; Print["2"]; For[n=3, n<=1000, n++, sum=Plus@@a; If[PrimeQ[sum], Print[n]]; a=RotateLeft[a]; a[[3]]=sum]

Extensions

a(27) corrected by Robert Price, May 22 2019
a(29) from Robert Price, May 23 2019

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

Original entry on oeis.org

0, 1, 2, 3, 7, 14, 27, 55, 110, 219, 439, 878, 1755, 3511, 7022, 14043, 28087, 56174, 112347, 224695, 449390, 898779, 1797559, 3595118, 7190235, 14380471, 28760942, 57521883, 115043767, 230087534, 460175067, 920350135, 1840700270, 3681400539, 7362801079, 14725602158, 29451204315
Offset: 0

Views

Author

Wojciech Florek, Feb 12 2018

Keywords

Comments

A generalized tribonacci (A001590) sequence.
For n > 2, 6*a(n) is the number of quaternary sequences of length n in which all triples (q(i),q(i+1),q(i+2)) contain two (arbitrarily chosen) digits, e.g., 0 and 3.
Similarly, recurrences a(n) = a(n-1) + a(n-2) + k*a(n-3) are related to binary (k=0, the Fibonacci sequence A000045), ternary (k=1, the tribonacci sequence A001590), quinary (k=3) and so on sequences with all triples (t(i),t(i+1),t(i+2)) containing two (arbitrarily chosen) digits (usually 0 and k+1).
For n > 0, a(n) is the number of ways to tile a strip of length n with squares, dominoes, and two colors of trominoes, with the restriction that the first tile cannot be a tromino. - Greg Dresden and Bora Bursalı, Aug 31 2023
For n > 1, a(n) is the number of ways to tile a strip of length n-2 with squares, dominoes, and two colors of trominoes, where the strip begins with an upper level of two cells. For example, when n=7 we have this strip of length 5:
_
|||_____
|||_|||. - Guanji Chen and Greg Dresden, Jun 17 2024

Examples

			For n=4 there are 6*7=42 quaternary sequences of length 4 such that each triple (i.e., exactly two of them: q1,q2,q3 and q2,q3,q4) contain both 0 and 3. They are 003x, 030x, 03y0, 0330, 330x, 303x, 30y3, 3003, 0y30, 3y03, y03x, y30x, where x=0,1,2,3 and y=1,2.
		

Crossrefs

Cf. A000045, A001590, A007040, A033129 (partial sums), A078043, A167373.

Programs

  • Mathematica
    LinearRecurrence[{1, 1, 2}, {0, 1, 2}, 50] (* Paolo Xausa, Aug 28 2024 *)
  • PARI
    my(x='x+O('x^99)); concat(0, Vec(x*(1+x)/(1-x-x^2-2*x^3))) \\ Altug Alkan, Mar 03 2018

Formula

a(n) = a(n-1) + a(n-2) + 2*a(n-3) for n > 2.
a(n+1)/a(n) tends to 2, the unique real root of x^3 - x^2 - x - 2 = 0.
a(n+1) = abs(A078043(n)).
7*a(n) = 3*2^n - A167373(n+1). - R. J. Mathar, Mar 24 2018
E.g.f.: exp(-x/2)*(9*exp(5*x/2) - 9*cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2))/21. - Stefano Spezia, Aug 29 2024
Previous Showing 31-40 of 135 results. Next