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 41-50 of 100 results. Next

A106295 Period of the Lucas 4-step sequence A073817 mod n.

Original entry on oeis.org

1, 5, 26, 10, 312, 130, 342, 20, 78, 1560, 120, 130, 84, 1710, 312, 40, 4912, 390, 6858, 1560, 4446, 120, 12166, 260, 1560, 420, 234, 1710, 280, 1560, 61568, 80, 1560, 24560, 17784, 390, 1368, 34290, 1092, 1560, 240, 22230, 162800, 120, 312, 60830, 103822
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence is the same as the period of Fibonacci 4-step sequence (A000078) mod n for n<563 because the discriminant of the characteristic polynomial x^4-x^3-x^2-x-1 is -563. The two sequences differ only at n that are multiples of 563.

Crossrefs

Cf. A000078, A073817, A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1).

Programs

  • Mathematica
    n=4; Table[p=i; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 60}]
  • Python
    from itertools import count
    def A106295(n):
        a = b = (4%n,1%n,3%n,7%n)
        s = sum(b) % n
        for m in count(1):
            b, s = b[1:] + (s,), (s+s-b[0]) % n
            if a == b:
                return m # Chai Wah Wu, Feb 22-27 2022

Formula

Let the prime factorization of n be p1^e1...pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)).
a(2^k) = 5*2^(k-1) for k > 0. If a(p) != a(p^2) for p prime, then a(p^k) = p^(k-1)*a(p) for k > 0 [Waddill, 1992]. - Chai Wah Wu, Feb 25 2022

A100532 The first four numbers of this sequence are the primes 2,3,5,7. The other terms are calculated by adding the previous four terms.

Original entry on oeis.org

2, 3, 5, 7, 17, 32, 61, 117, 227, 437, 842, 1623, 3129, 6031, 11625, 22408, 43193, 83257, 160483, 309341, 596274, 1149355, 2215453, 4270423, 8231505, 15866736, 30584117, 58952781, 113635139, 219038773, 422210810, 813837503, 1568722225, 3023809311, 5828579849
Offset: 1

Views

Author

Parthasarathy Nambi, Nov 24 2004

Keywords

Examples

			The fifth term is 2 + 3 + 5 + 7 = 17.
		

Crossrefs

Programs

  • Magma
    [n le 4 select NthPrime(n) else Self(n-1)+Self(n-2)+Self(n-3)+Self(n-4): n in [1..41]]; // G. C. Greubel, Jun 30 2022
    
  • Mathematica
    LinearRecurrence[{1,1,1,1}, {2,3,5,7}, 40] (* G. C. Greubel, Jun 30 2022 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; 1,1,1,1]^(n-1)*[2;3;5;7])[1,1] \\ Charles R Greathouse IV, Nov 01 2018
    
  • SageMath
    @CachedFunction
    def a(n): # a = A100532
        if (n<5): return nth_prime(n)
        else: return sum( a(n-j) for j in (1..4))
    [a(n) for n in (1..40)] # G. C. Greubel, Jun 30 2022

Formula

a(n) = a(n-1) + a(n-2) + a(n-3) + a(n-4) where n >= 5 and a(1) = 2, a(2) = 3, a(3) = 5 and a(4) = 7.
G.f.: x*(1-x)*(2+3*x+3*x^2) / ( 1-x-x^2-x^3-x^4 ). - R. J. Mathar, Feb 03 2011

A254990 4-bonacci word. Fixed point of morphism 0->01, 1->02, 2->03, 3->0.

Original entry on oeis.org

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

Views

Author

Ondrej Turek, Feb 11 2015

Keywords

Comments

Special case of k-bonacci word for k = 4 (see crossrefs).
The lengths of iterations S(i) are Tetranacci numbers (A000078).
Set S(0) = 0; S(1) = 0,1; S(2) = 0,1,0,2; S(3) = 0,1,0,2,0,1,0,3; for n >= 4: S(n) = S(n-1) S(n-2) S(n-3) S(n-4). The sequence is the limit S(infinity).

Examples

			The iterates are:
0
01
0102
01020103
010201030102010
01020103010201001020103010201
01020103010201001020103010201010201030102010010201030102
...
		

Crossrefs

Cf. A000078 (lengths of iterations).
Cf. A003849 (k=2, Fibonacci word), A080843 (k=3, Tribonacci word).

Programs

  • Mathematica
    Nest[Flatten[#/.{0->{0,1},1->{0,2},2->{0,3},3->0}]&,0,7] (* Harvey P. Dale, Mar 26 2015 *)

A251656 4-step Fibonacci sequence starting with 1,0,1,0.

Original entry on oeis.org

1, 0, 1, 0, 2, 3, 6, 11, 22, 42, 81, 156, 301, 580, 1118, 2155, 4154, 8007, 15434, 29750, 57345, 110536, 213065, 410696, 791642, 1525939, 2941342, 5669619, 10928542, 21065442, 40604945, 78268548, 150867477, 290806412, 560547382, 1080489819
Offset: 0

Views

Author

Arie Bos, Dec 06 2014

Keywords

Crossrefs

Other 4-step Fibonacci sequences are A000078, A000288, A001630, A001631, A001648, A073817, A100532, A251654, A251655, A251703, A251704, A251705.
Cf. A000336.

Programs

  • J
    NB. see A251655 for the program and apply it to 1,0,1,0.
  • Mathematica
    LinearRecurrence[Table[1, {4}], {1, 0, 1, 0}, 36] (* Michael De Vlieger, Dec 09 2014 *)

Formula

a(n+4) = a(n)+a(n+1)+a(n+2)+a(n+3).
G.f.: (-1+x+2*x^3)/(-1+x+x^2+x^3+x^4) . - R. J. Mathar, Mar 28 2025
a(n) = A000078(n+3)-A000078(n+2)-2*A000078(n). - R. J. Mathar, Mar 28 2025

A251703 4-step Fibonacci sequence starting with 1,1,0,0.

Original entry on oeis.org

1, 1, 0, 0, 2, 3, 5, 10, 20, 38, 73, 141, 272, 524, 1010, 1947, 3753, 7234, 13944, 26878, 51809, 99865, 192496, 371048, 715218, 1378627, 2657389, 5122282, 9873516, 19031814, 36685001, 70712613, 136302944, 262732372, 506432930, 976180859
Offset: 0

Views

Author

Arie Bos, Dec 07 2014

Keywords

Crossrefs

Other 4-step Fibonacci sequences are A000078, A000288, A001630, A001631, A001648, A073817, A100532, A251654, A251655, A251656, A251704, A251705.

Programs

  • J
    NB. see A251655 for the program and apply it to 1,1,0,0.
  • Mathematica
    LinearRecurrence[Table[1, {4}], {1, 1, 0, 0}, 36] (* Michael De Vlieger, Dec 09 2014 *)

Formula

a(n+4) = a(n) + a(n+1) + a(n+2) + a(n+3).
G.f.: (-1+2*x^2+2*x^3)/(-1+x+x^2+x^3+x^4) . - R. J. Mathar, Mar 28 2025
a(n) = A000078(n+3)-2*A000078(n+1)-2*A000078(n). - R. J. Mathar, Mar 28 2025

A000102 a(n) = number of compositions of n in which the maximum part size is 4.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 5, 12, 27, 59, 127, 269, 563, 1167, 2400, 4903, 9960, 20135, 40534, 81300, 162538, 324020, 644282, 1278152, 2530407, 5000178, 9863763, 19427976, 38211861, 75059535, 147263905, 288609341, 565047233, 1105229439, 2159947998, 4217784107, 8230006378
Offset: 0

Views

Author

Keywords

Comments

a(n) is also the number of binary sequences of length n-1 in which the longest run of consecutive 0's is exactly three. - Geoffrey Critzer, Nov 06 2008

Examples

			For example, a(6)=5 counts 1+1+4, 2+4, 4+2, 4+1+1, 1+4+1. - _David Callan_, Dec 09 2004
a(6)=5 because there are 5 binary sequences of length 5 in which the longest run of consecutive 0's is exactly 3; 00010, 00011, 01000, 10001, 11000. - _Geoffrey Critzer_, Nov 06 2008
		

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 155.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • J. L. Yucas, Counting special sets of binary Lyndon words, Ars Combin., 31 (1991), 21-29.

Programs

  • Maple
    a:= n-> (Matrix(7, (i,j)-> if i+1=j then 1 elif j=1 then [2, 1, 0, -2, -3, -2, -1][i] else 0 fi)^n)[1,5]: seq(a(n), n=0..40); # Alois P. Heinz, Oct 07 2008
  • Mathematica
    a[n_] := MatrixPower[ Table[ Which[i+1 == j, 1, j == 1, {2, 1, 0, -2, -3, -2, -1}[[i]], True, 0], {i, 1, 7}, {j, 1, 7}], n][[1, 5]]; Table[a[n], {n, 0, 34}] (* Jean-François Alcover, May 28 2013, after Alois P. Heinz *)
    LinearRecurrence[{2,1,0,-2,-3,-2,-1},{0,0,0,0,1,2,5},40] (* Harvey P. Dale, Jul 01 2013 *)

Formula

G.f.: x^4/(1 - x - x^2 - x^3)/(1 - x - x^2 - x^3 - x^4).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-4) - 3*a(n-5) - 2*a(n-6) - a(n-7). Convolution of tribonacci and tetranacci numbers (A000073 and A000078). - Franklin T. Adams-Watters, Jan 13 2006

Extensions

More terms from Sascha Kurz, Aug 15 2002
Definition improved by David Callan and Franklin T. Adams-Watters

A104577 Indices of prime generalized tetranacci numbers, A073817.

Original entry on oeis.org

2, 3, 8, 9, 16, 19, 24, 27, 46, 68, 71, 78, 107, 198, 309, 377, 477, 1057, 1631, 2419, 3974, 4293, 8247, 10513, 10709, 12011, 15042, 30543, 31607, 39664, 47552, 145858
Offset: 1

Views

Author

T. D. Noe, Mar 16 2005

Keywords

Comments

The sequence of generalized tetranacci numbers is defined as beginning with 1, 3, 7, 15. Subsequent terms are the sum of the previous four terms. Note that the sequence of these generalized tetranacci numbers has many more primes than the tetranacci sequence A000078 (whose prime indices are in A104534).

Crossrefs

Cf. A104576 (indices of prime generalized tribonacci numbers).

Programs

  • Mathematica
    a={-1, -1, -1, 4}; Do[s=Plus@@a; a=RotateLeft[a]; a[[4]]=s; If[PrimeQ[s], Print[n]], {n, 30000}]

A124168 Union of all n-Fibonacci sequences, that is, all sequences s(0) = s(1) = ... = s(n-2) = 0, s(n-1) = 1 and for k >= n, s(k) = s(k-1) + ... + s(k-n).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 13, 15, 16, 21, 24, 29, 31, 32, 34, 44, 55, 56, 61, 63, 64, 81, 89, 108, 120, 125, 127, 128, 144, 149, 208, 233, 236, 248, 253, 255, 256, 274, 377, 401, 464, 492, 504, 509, 511, 512, 610, 773, 912, 927, 976, 987, 1004, 1016, 1021, 1023, 1024
Offset: 1

Views

Author

Carlos Alves, Dec 03 2006

Keywords

Comments

Note that an n-Fibonacci sequence contains the numbers 2^k numbers for kA001792 (for n large)...
Noe and Post conjectured that the only positive terms that are common to any two distinct n-step Fibonacci sequences are the powers of 2 that begin each sequence and 13 (in 2- and 3-step) and 504 (in 3- and 7-step). Perhaps we should also include 8 (in 2- and 4-step). - T. D. Noe, Dec 05 2006

Crossrefs

Cf. A227880 (primes here).

Programs

  • Mathematica
    NFib25[nfb_] := Transpose[NestList[Join[Drop[ #, {1}], {Plus @@ #}] &, Map[If[ # == nfb, 1, 0] &, Range[nfb]], 25]][[ -1]]; Union[Flatten[Map[NFib25, Range[2, 20]]]][[Range[100]]]
    NFib[nfb_, lim_] := Module[{f = 2^Range[0, nfb - 1]}, While[f[[-1]] <= lim, AppendTo[f, Total[Take[f, -nfb]]]]; Most[f]]; lim = 12; Union[Flatten[Table[NFib[i, 2^lim], {i, 2, lim + 1}]]] (* T. D. Noe, Oct 25 2013 *)

Formula

Extensions

Edited by N. J. A. Sloane, Dec 15 2006

A168084 Fibonacci 13-step numbers.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8191, 16381, 32760, 65516, 131024, 262032, 524032, 1048000, 2095872, 4191488, 8382464, 16763904, 33525760, 67047424, 134086657, 268156933, 536281106, 1072496696
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    k:=13:a:=taylor((z^(k-1)-z^(k))/(1-2*z+z^(k+1)),z=0,51);for p from 0 to 50 do j(p):=coeff(a,z,p):od :seq(j(p),p=0..50); k:=13:for n from 0 to 50 do l(n):=sum((-1)^i*binomial(n-k+1-k*i,i)*2^(n-k+1-(k+1)*i),i=0..floor((n-k+1)/(k+1)))-sum((-1)^i*binomial(n-k-k*i,i)*2^(n-k-(k+1)*i),i=0..floor((n-k)/(k+1))):od:seq(l(n),n=0..50); # Richard Choulet, Feb 22 2010
  • Mathematica
    a={1,0,0,0,0,0,0,0,0,0,0,0,0};Flatten[Prepend[Table[s=Plus@@a;a=RotateLeft[a];a[[ -1]]=s,{n,60}],Table[0,{m,Length[a]-1}]]]
    LinearRecurrence[{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, 50]
    With[{nn=13},LinearRecurrence[Table[1,{nn}],Join[Table[0,{nn-1}],{1}],50]] (* Harvey P. Dale, Aug 17 2013 *)

Formula

Another form of the g.f. f: f(z)=(z^(k-1)-z^(k))/(1-2*z+z^(k+1)) with k=13. then a(n)=sum((-1)^i*binomial(n-k+1-k*i,i)*2^(n-k+1-(k+1)*i),i=0..floor((n-k+1)/(k+1)))-sum((-1)^i*binomial(n-k-k*i,i)*2^(n-k-(k+1)*i),i=0..floor((n-k)/(k+1))) with k=13 and convention sum(alpha(i),i=m..n)=0 for m>n. - Richard Choulet, Feb 22 2010

A220547 Number of ways to reciprocally link elements of an n X 2 array either to themselves or to exactly one horizontal, vertical or antidiagonal neighbor.

Original entry on oeis.org

2, 8, 29, 108, 401, 1490, 5536, 20569, 76424, 283953, 1055026, 3919944, 14564533, 54114452, 201061985, 747044834, 2775641472, 10312882481, 38317465040, 142368356257, 528968939938, 1965381541064, 7302365621709, 27131904192124
Offset: 1

Views

Author

R. H. Hardin, Dec 15 2012

Keywords

Comments

Column 2 of A220553.

Examples

			Some solutions for n=3 0=self 2=n 3=ne 4=w 6=e 7=sw 8=s (reciprocal directions total 10):
..8..8....0..7....6..4....6..4....8..0....0..0....0..0....0..0....0..8....6..4
..2..2....3..8....0..0....6..4....2..8....8..8....0..8....0..0....8..2....8..8
..6..4....0..2....0..0....0..0....0..2....2..2....0..2....0..0....2..0....2..2
		

Crossrefs

Formula

Empirical: a(n) = 3*a(n-1) + 3*a(n-2) - a(n-3) - a(n-4).
Empirical g.f.: x*(1 + x)*(2 - x^2) / (1 - 3*x - 3*x^2 + x^3 + x^4). - Colin Barker, Mar 13 2018
Empirical: a(n) = A000078(2*n + 3). - Greg Dresden, Jan 10 2021
Previous Showing 41-50 of 100 results. Next