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 61-70 of 100 results. Next

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

Original entry on oeis.org

0, 1, 3, 7, 14, 28, 55, 107, 207, 400, 772, 1489, 2871, 5535, 10670, 20568, 39647, 76423, 147311, 283952, 547336, 1055025, 2033627, 3919943, 7555934, 14564532, 28074039, 54114451, 104308959, 201061984, 387559436, 747044833, 1439975215
Offset: 0

Views

Author

Roger L. Bagula, Dec 04 2003

Keywords

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 50);
    Coefficients(R!( x*(1+x+x^2)/(1-2*x+x^5) )); // G. C. Greubel, Feb 19 2021
  • Mathematica
    CoefficientList[Series[x*(1+x+x^2)/(1-2*x+x^5), {x, 0, 50}], x] (* G. C. Greubel, Feb 19 2021 *)
  • Sage
    def A089074_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x*(1+x+x^2)/(1-2*x+x^5) ).list()
    a=A089074_list(51); a[1:] # G. C. Greubel, Feb 19 2021
    

Formula

From N. J. A. Sloane, Dec 05 2003: (Start)
G.f.: x*(1+x+x^2)/(1-2*x+x^5).
a(n) = 2*a(n-1) - a(n-5) for n >= 6. (End)
a(n) = A000078(n+4) - 1. - G. C. Greubel, Feb 19 2021

Extensions

Title and offset changed by G. C. Greubel, Feb 19 2021

A100329 a(n) = -a(n-1) -a(n-2) -a(n-3) +a(n-4), a(0)=0, a(1)=1, a(2)=-1, a(3)=0.

Original entry on oeis.org

0, 1, -1, 0, 0, 2, -3, 1, 0, 4, -8, 5, -1, 8, -20, 18, -7, 17, -48, 56, -32, 41, -113, 160, -120, 114, -267, 433, -400, 348, -648, 1133, -1233, 1096, -1644, 2914, -3599, 3425, -4384, 7472, -10112, 10449, -12193, 19328, -27696, 31010, -34835, 50849, -74720, 89716, -100680
Offset: 0

Views

Author

Mitch Harris, Nov 16 2004

Keywords

Comments

Reflected tetranacci numbers (see 1st formula).

Crossrefs

Cf. A000078.
Cf. A000073 (tribonacci), A057597 (reflected tribonacci).

Programs

  • Magma
    I:=[0,1,-1,0]; [n le 4 select I[n] else -Self(n-1) -Self(n-2) -Self(n-3) +Self(n-4): n in [1..61]]; // G. C. Greubel, Jan 30 2023
    
  • Maple
    a:= n-> (<<1|1|0|0>, <1|0|1|0>, <1|0|0|1>, <1|0|0|0>>^(-n))[1, 4]:
    seq(a(n), n=0..50);  # Alois P. Heinz, Jun 12 2008
  • Mathematica
    CoefficientList[Series[x/(1+x+x^2+x^3-x^4), {x, 0, 50}], x]
    LinearRecurrence[{-1,-1,-1,1},{0,1,-1,0},60] (* Harvey P. Dale, May 20 2018 *)
  • SageMath
    @CachedFunction
    def a(n): # a=A100329
        if (n<4): return (0,1,-1,0)[n]
        else: return -a(n-1)-a(n-2)-a(n-3)+a(n-4)
    [a(n) for n in range(61)] # G. C. Greubel, Jan 30 2023

Formula

a(n) = A000078(-n).
Let Q(n) = A000078, then a(n) = (-1)^(n+1)*(Q(n)^3 - 2*Q(n-1)*Q(n) *Q(n+1) + Q(n-2)*Q(n+1)^2 + Q(n-1)^2*Q(n+2) - Qn(-2)*Q(n)*Q(n+2)) derived from powers of the inverse of a generalized Fibonacci matrix.
G.f.: x/(1+x+x^2+x^3-x^4).
G.f. of absolute values: x/(1-x+x^2-x^3-x^4). - Vaclav Kotesovec, Oct 18 2013
a(n) = term (1,4) in the 4 X 4 matrix [1,1,0,0; 1,0,1,0; 1,0,0,1; 1,0,0,0]^(-n). - Alois P. Heinz, Jun 12 2008

A105758 Indices of prime hexanacci (or Fibonacci 6-step) numbers A001592 (using offset -4).

Original entry on oeis.org

3, 36, 37, 92, 660, 6091, 8415, 11467, 13686, 38831, 49828, 97148
Offset: 1

Views

Author

T. D. Noe, Apr 22 2005

Keywords

Comments

No other n < 30000.
This sequence uses the convention of the Noe and Post reference. Their indexing scheme differs by 4 from the indices in A001592. Sequence A249635 lists the indices of the same primes (A105759) using the indexing scheme as defined in A001592. - Robert Price, Nov 02 2014 [Edited by M. F. Hasler, Apr 22 2018]
a(13) > 3*10^5. - Robert Price, Nov 02 2014

Crossrefs

Cf. A105759 (prime Fibonacci 6-step numbers), A249635 (= a(n) + 4), A001592.
Cf. A000045, A000073, A000078 (and A001631), A001591, A122189 (or A066178), A079262, A104144, A122265, A168082, A168083 (Fibonacci, tribonacci, tetranacci numbers and other generalizations).
Cf. A005478, A092836, A104535, A105757, A105761, ... (primes in these sequence).
Cf. A001605, A303263, A303264 (and A104534 and A247027), A248757 (and A105756), ... (indices of primes in A000045, A000073, A000078, ...).

Programs

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

Formula

a(n) = A249635(n) - 4. A105759(n) = A001592(A249635(n)) = A001592(a(n) + 4). - M. F. Hasler, Apr 22 2018

Extensions

a(10)-a(12) from Robert Price, Nov 02 2014
Edited by M. F. Hasler, Apr 22 2018

A106280 Primes p such that the polynomial x^4-x^3-x^2-x-1 mod p has 4 distinct zeros.

Original entry on oeis.org

137, 179, 653, 859, 991, 1279, 1601, 1609, 2089, 2437, 2591, 2693, 2789, 2897, 3701, 3823, 3847, 4451, 4691, 4751, 4919, 5431, 5479, 5807, 5903, 5953, 6203, 6421, 6781, 6917, 7253, 7867, 8317, 9187, 9277, 9533, 9629, 9767, 9907, 9967, 10009, 10079
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This polynomial is the characteristic polynomial of the Fibonacci and Lucas 4-step sequences, A000078 and A073817. The periods of the sequences A000078(k) mod p and A073817(k) mod p have length less than p.

Crossrefs

Cf. A106277 (number of distinct zeros of x^4-x^3-x^2-x-1 mod prime(n)), A106296 (period of 4-step sequence mod prime(n)).

Programs

  • Mathematica
    t=Table[p=Prime[n]; cnt=0; Do[If[Mod[x^4-x^3-x^2-x-1, p]==0, cnt++ ], {x, 0, p-1}]; cnt, {n, 1600}];Prime[Flatten[Position[t, 4]]]

A106283 Primes p such that the polynomial x^4-x^3-x^2-x-1 mod p has no zeros.

Original entry on oeis.org

2, 5, 11, 13, 31, 43, 53, 79, 83, 89, 97, 103, 109, 131, 139, 151, 197, 199, 229, 233, 239, 251, 257, 271, 283, 313, 317, 347, 359, 367, 379, 389, 433, 443, 461, 479, 487, 521, 569, 571, 577, 593, 599, 601, 617, 631, 641, 643, 647, 659, 673, 677, 719, 769, 797
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This polynomial is the characteristic polynomial of the Fibonacci and Lucas 4-step sequences, A000078 and A073817.

Crossrefs

Cf. A106277 (number of distinct zeros of x^4-x^3-x^2-x-1 mod prime(n)), A106296 (period of Lucas 4-step sequence mod prime(n)), A003631 (primes p such that x^2-x-1 is irreducible in mod p).

Programs

  • Maple
    Res:= NULL: count:= 0: p:= 0:
    P:= x^4 - x^3 - x^2 - x - 1:
    while count < 100 do
      p:= nextprime(p);
      if [msolve(P,p)] = [] then
        Res:= Res, p; count:= count+1;
      fi
    od:
    Res; # Robert Israel, Mar 13 2024
  • Mathematica
    t=Table[p=Prime[n]; cnt=0; Do[If[Mod[x^4-x^3-x^2-x-1, p]==0, cnt++ ], {x, 0, p-1}]; cnt, {n, 200}];Prime[Flatten[Position[t, 0]]]
  • Python
    from itertools import islice
    from sympy import Poly, nextprime
    from sympy.abc import x
    def A106283_gen(): # generator of terms
        p = 2
        while True:
            if len(Poly(x*(x*(x*(x-1)-1)-1)-1, x, modulus=p).ground_roots())==0:
                yield p
            p = nextprime(p)
    A106283_list = list(islice(A106283_gen(),20)) # Chai Wah Wu, Mar 14 2024

Extensions

Name corrected by Robert Israel, Mar 13 2024

A106296 Period of the Lucas 4-step sequence A073817 mod prime(n).

Original entry on oeis.org

5, 26, 312, 342, 120, 84, 4912, 6858, 12166, 280, 61568, 1368, 240, 162800, 103822, 303480, 205378, 226980, 100254, 357910, 2664, 998720, 1157520, 9320, 368872, 1030300, 10608, 1225042, 2614040, 13874, 2048382, 4530768, 136, 772880, 3307948
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 prime(n) except for n=103, which corresponds to the prime 563 because the discriminant of the characteristic polynomial x^4-x^3-x^2-x-1 is -563. We have a(n) < prime(n) for primes 563 and A106280.

Crossrefs

Cf. A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1), A106280 (primes p such that x^4-x^3-x^2-x-1 mod p has 4 distinct zeros), A106295.

Programs

  • Mathematica
    n=4; Table[p=Prime[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}]

Formula

a(n) = A106295(prime(n)).

A119407 Number of nonempty subsets of {1,2,...,n} with no gap of length greater than 4 (a set S has a gap of length d if a and b are in S but no x with a < x < b is in S, where b-a=d).

Original entry on oeis.org

1, 3, 7, 15, 31, 62, 122, 238, 462, 894, 1727, 3333, 6429, 12397, 23901, 46076, 88820, 171212, 330028, 636156, 1226237, 2363655, 4556099, 8782171, 16928187, 32630138, 62896622, 121237146, 233692122, 450456058, 868281979, 1673667337, 3226097529, 6218502937, 11986549817, 23104817656
Offset: 1

Views

Author

John W. Layman, Jul 25 2006

Keywords

Comments

The numbers of subsets of {1,2,...,n} with no gap of length greater than d, for d=1,2 and 3, seem to be given in A000217, A001924 and A062544, respectively.

Examples

			G.f. = x + 3*x^2 + 7*x^3 + 15*x^4 + 31*x^5 + 62*x^6 + 122*x^7 + 238*x^8 + 462*x^9 + ...
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( x/((1-x)*(1-2*x+x^5)) )); // G. C. Greubel, Jun 05 2019
    
  • Mathematica
    Rest@CoefficientList[Series[x/((1-x)*(1-2*x+x^5)), {x, 0, 40}], x] (* G. C. Greubel, Jun 05 2019 *)
    LinearRecurrence[{3,-2,0,0,-1,1},{1,3,7,15,31,62},40] (* Harvey P. Dale, Dec 04 2019 *)
  • PARI
    {a(n) = if( n<0, n = -n; polcoeff( x^5 / ((1 - x)^2 * (1 + x + x^2 + x^3 - x^4)) + x * O(x^n), n), polcoeff( x / ((1 - x)^2 * (1 - x - x^2 - x^3 - x^4)) + x * O(x^n), n))} /* Michael Somos, Dec 28 2012 */
    
  • PARI
    my(x='x+O('x^40)); Vec(x/((1-x)*(1-2*x+x^5))) \\ G. C. Greubel, Jun 05 2019
    
  • Sage
    a=(x/((1-x)*(1-2*x+x^5))).series(x, 40).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Jun 05 2019

Formula

G.f. for number of nonempty subsets of {1,2,...,n} with no gap of length greater than d is x/((1-x)*(1-2*x+x^(d+1))). - Vladeta Jovovic, Apr 27 2008
From Michael Somos, Dec 28 2012: (Start)
G.f.: x/((1-x)^2*(1-x-x^2-x^3-x^4)) = x/((1-x)*(1-2*x+x^5)).
First difference is A107066. (End)
a(n-3) = Sum_{k=0..n} (n-k)*A000078(k) for n>3. - Greg Dresden, Jan 01 2021

Extensions

Terms a(25) onward added by G. C. Greubel, Jun 05 2019

A247506 Generalized Fibonacci numbers: square array A(n,k) read by ascending antidiagonals, A(n,k) = [x^k]((1-Sum_{j=1..n} x^j)^(-1)), (n>=0, k>=0).

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 4, 5, 1, 0, 1, 1, 2, 4, 7, 8, 1, 0, 1, 1, 2, 4, 8, 13, 13, 1, 0, 1, 1, 2, 4, 8, 15, 24, 21, 1, 0, 1, 1, 2, 4, 8, 16, 29, 44, 34, 1, 0, 1, 1, 2, 4, 8, 16, 31, 56, 81, 55, 1, 0
Offset: 0

Views

Author

Peter Luschny, Nov 02 2014

Keywords

Examples

			[n\k] [0][1][2][3][4] [5] [6] [7]  [8]  [9] [10]  [11]  [12]
   [0] 1, 0, 0, 0, 0,  0,  0,  0,   0,   0,   0,    0,    0
   [1] 1, 1, 1, 1, 1,  1,  1,  1,   1,   1,   1,    1,    1
   [2] 1, 1, 2, 3, 5,  8, 13, 21,  34,  55,  89,  144,  233  [A000045]
   [3] 1, 1, 2, 4, 7, 13, 24, 44,  81, 149, 274,  504,  927  [A000073]
   [4] 1, 1, 2, 4, 8, 15, 29, 56, 108, 208, 401,  773, 1490  [A000078]
   [5] 1, 1, 2, 4, 8, 16, 31, 61, 120, 236, 464,  912, 1793  [A001591]
   [6] 1, 1, 2, 4, 8, 16, 32, 63, 125, 248, 492,  976, 1936  [A001592]
   [7] 1, 1, 2, 4, 8, 16, 32, 64, 127, 253, 504, 1004, 2000  [A066178]
   [8] 1, 1, 2, 4, 8, 16, 32, 64, 128, 255, 509, 1016, 2028  [A079262]
   [.] .  .  .  .  .   .   .   .    .    .    .     .     .
  [oo] 1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048  [A011782]
.
As a triangular array, starts:
  1,
  1, 0,
  1, 1, 0,
  1, 1, 1, 0,
  1, 1, 2, 1, 0,
  1, 1, 2, 3, 1, 0,
  1, 1, 2, 4, 5, 1, 0,
  1, 1, 2, 4, 7, 8, 1, 0,
  1, 1, 2, 4, 8, 13, 13, 1, 0,
  1, 1, 2, 4, 8, 15, 24, 21, 1, 0,
  ...
		

Crossrefs

Programs

  • Maple
    A := (n,k) -> coeff(series((1-add(x^j, j=1..n))^(-1),x,k+2),x,k):
    seq(print(seq(A(n,k), k=0..12)), n=0..9);
  • Mathematica
    A[n_, k_] := A[n, k] = If[k<0, 0, If[k==0, 1, Sum[A[n, j], {j, k-n, k-1}]]]; Table[A[n-k, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 08 2019 *)

Formula

A(n, k) = Sum_{j=0..floor(k/(n+1))} (-1)^j*((k - j*n) + j + delta(k,0))/(2*(k - j*n) + delta(k,0))*binomial(k - j*n, j)*2^(k-j*(n+1)), where delta denotes the Kronecker delta (see Corollary 3.2 in Parks and Wills). - Stefano Spezia, Aug 06 2022

A275544 Number of distinct terms at a given iteration of the Collatz (or 3x+1) map starting with 0.

Original entry on oeis.org

1, 2, 4, 8, 15, 29, 56, 108, 208, 400, 766, 1465, 2793, 5314, 10088, 19115, 36156, 68290, 128817, 242720, 456884, 859269, 1614809, 3032673, 5692145, 10678326, 20023239, 37531218, 70323203, 131725663, 246674211, 461819857, 864428716, 1617723538, 3026965088, 5663003895, 10593269487, 19813600282
Offset: 0

Views

Author

Rok Cestnik, Aug 01 2016

Keywords

Comments

If one considers an algebraic approach to the Collatz conjecture, the tree of outcomes of the "Half Or Triple Plus One" process starting with a natural number n:
i
0: n
1: 3n+1 n/2
2: 9n+4 (3/2)n+1/2 (3/2)n+1 n/4
3: 27n+13 (9/2)n+2 (9/2)n+5/2 (3/4)n+1/4 (9/2)n+4 (3/4)n+1/2 (3/4)n+1 n/8
...
reveals that any n that is part of a cycle has to satisfy an equation of the following form:
(3^(i-p)/2^p - 1)n + x_i = 0 i = 0,1,2,3,... p = 0,...,i
where x_i are the possible constant terms at iteration i, i.e.,
x_0 = [0],
x_1 = [1,0],
x_2 = [4,1/2,1,0],
x_3 = [13,2,5/2,1/4,4,1/2,1,0],
x_4 = [40,13/2,7,1,17/2,5/4,7/4,1/8,13,2,5/2,1/4,4,1/2,1,0],
...
(Note that not all the combinations of members of x_i and numbers p yield an equation that corresponds to n having to belong to a cycle, instead satisfying at least one equation of the form above is a necessary condition for every n that does).
This sequence is composed of the numbers of distinct possible constant terms at each iteration i.
The only constant term at the zeroth iteration is 0. Since at each iteration both half and triple plus one is considered, the halving of 0 always yields another 0, which always has the same progression tree, and therefore each set x_i contains the members of all previous sets x_j where j < i. This is also the reason why the sequence at the beginning resembles powers of 2 A000079, but later falls behind as more and more duplicates arise.
This sequence is related to A275545, if one sequence is known it is possible to work out the other (see formula).
An empirical observation suggests that the same sequence of numbers arises if we analogously consider the 3n-1 problem (the Collatz conjecture can be referred to as the 3n+1 problem).
The first 9 terms coincide with the tetranacci numbers A000078.

Examples

			a(3) = 8 since x_3 has 8 members and they are all distinct.
a(4) = 15 since x_4 has 16 members but the number 1 appears twice.
		

Crossrefs

Programs

  • Mathematica
    nmax = 25; s = {0}; a[0] = 1;
    Do[s = Join[3s + 1, s/2]; Print[n, " ", a[n] = s//Union//Length], {n, nmax}];
    a /@ Range[0, nmax] (* Jean-François Alcover, Nov 16 2019 *)
  • Python
    from fractions import Fraction
    A275544_list, c = [1], [Fraction(0,1)]
    for _ in range(20):
        c = set(e for d in c for e in (3*d+1,d/2))
        A275544_list.append(len(c)) # Chai Wah Wu, Sep 02 2016

Formula

a(0) = 1; a(n) = 2*a(n-1) - A275545(n), n >= 1.

Extensions

a(27)-a(29) corrected and a(30) added by Chai Wah Wu, Sep 02 2016
a(31)-a(37) from Hugo Pfoertner, Apr 23 2023

A351657 Period of the Fibonacci n-step sequence mod n.

Original entry on oeis.org

1, 3, 13, 10, 781, 728, 137257, 36, 273, 212784, 28531167061, 42640
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 16 2022

Keywords

Comments

From Chai Wah Wu, Feb 23 2022: (Start)
a(14) = 92269645680
a(15) = 4976066589192413
a(16) = 136
a(18) = 306281976
(End)

Examples

			For n = 4, take the tetranacci sequence (A000078), 0, 0, 0, 1, 1, 2, 4, 8, 15, 29, 56, 108, 208, ... (mod 4), which gives 0, 0, 0, 1, 1, 2, 0, 0, 3, 1, 0, 0, 0, 1, 1, 2, ... This repeats a pattern of length 10, so a(4) = 10.
		

Crossrefs

Programs

  • Python
    from math import lcm
    from itertools import count
    from sympy import factorint
    def f(n,pe): # period of the Fibonacci n-step sequence mod pe
        a = b = (0,)*(n-1)+(1%pe,)
        s = 1 % pe
        for m in count(1):
            b, s = b[1:] + (s,), (s+s-b[0]) % pe
            if a == b:
                return m
    def A351657(n): return 1 if n == 1 else lcm(*(f(n,p**e) for p, e in factorint(n).items())) # Chai Wah Wu, Feb 23-27 2022

Formula

From Chai Wah Wu, Feb 22 2022: (Start)
Conjecture 1: a(p) = (p^p-1)/(p-1) for p prime, i.e., a(A000040(n)) = A001039(n).
Conjecture 2: a(2^k) = 2^(k-1)*(1+2^k) = A007582(k).
Conjecture 3 (which implies Conjectures 1 and 2): a(p^k) = (p^(p*k)-1)*p^(k-1)/(p^k-1) for k > 0 and prime p.
(End)

Extensions

a(11)-a(12) from Chai Wah Wu, Feb 22 2022
Previous Showing 61-70 of 100 results. Next