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.

User: Patrick D McLean

Patrick D McLean's wiki page.

Patrick D McLean has authored 7 sequences.

A302126 Interleaved Fibonacci and Lucas numbers.

Original entry on oeis.org

0, 2, 1, 1, 1, 3, 2, 4, 3, 7, 5, 11, 8, 18, 13, 29, 21, 47, 34, 76, 55, 123, 89, 199, 144, 322, 233, 521, 377, 843, 610, 1364, 987, 2207, 1597, 3571, 2584, 5778, 4181, 9349, 6765, 15127, 10946, 24476, 17711, 39603, 28657, 64079, 46368, 103682, 75025, 167761
Offset: 0

Author

Patrick D McLean, Apr 01 2018

Keywords

Examples

			a(10) = Fibonacci(5) = 5;
a(11) = Lucas(5) = 11.
		

Crossrefs

Interleaves A000045 and A000032.

Programs

  • GAP
    Flat(List([1..25],n->[Fibonacci(n),Lucas(1,-1,n)[2]])); # Muniru A Asiru, Apr 02 2018
  • Maple
    a:= n-> (<<0|1>, <1|1>>^iquo(n, 2, 'r'). <<2*r, 1>>)[1, 1]:
    seq(a(n), n=0..60);  # Alois P. Heinz, Apr 23 2018
  • Mathematica
    Table[{Fibonacci[n], LucasL[n]}, {n, 0, 25}] // Flatten
    LinearRecurrence[{0, 1, 0, 1}, {0, 2, 1, 1}, 52]
    Flatten@ Array[{LucasL@#, Fibonacci@#} &, 26, 0] (* or *)
    CoefficientList[Series[(x^3 - x^2 - 2x)/(x^4 + x^2 - 1), {x, 0, 51}], x] (* Robert G. Wilson v, Apr 02 2018 *)
  • PARI
    concat(0, Vec(x*(2 - x)*(1 + x) / (1 - x^2 - x^4) + O(x^60))) \\ Colin Barker, Apr 02 2018
    

Formula

a(0) = 0; a(1) = 2; a(2) = 1; a(3) = 1; a(n) = a(n-2) + a(n-4), n >= 4.
G.f.: x*(2 - x)*(1 + x) / (1 - x^2 - x^4). - Colin Barker, Apr 02 2018
a(0) = 0; a(1) = 2; a(2n) = (a(2n-1) + a(2n-2))/2; a(2n+1) = a(2n) + 2*a(2n-2), n >= 1. - Daniel Forgues, Jul 29 2018

Extensions

More terms from Colin Barker, Apr 02 2018

A284786 Pisano period of sequence A006054 modulo n.

Original entry on oeis.org

1, 7, 26, 14, 62, 182, 42, 28, 78, 434, 266, 182, 12, 42, 806, 56, 614, 546, 254, 434, 546, 266, 1106, 364, 310, 84, 234, 42, 28, 5642, 1986, 112, 3458, 4298, 1302, 546, 2814, 1778, 156, 868, 40, 546, 42, 266, 2418, 1106, 4514, 728, 294, 2170, 7982, 84, 5726, 1638, 8246, 84, 3302, 28, 7082, 5642, 582
Offset: 1

Author

Patrick D McLean, Apr 02 2017

Keywords

Crossrefs

Cf. A001175 Pisano periods of Fibonacci numbers mod n.
Cf. A045472.

Programs

  • Maple
    f:= proc(n) option remember; local F, t, k, a;
    F:= ifactors(n)[2];
    if nops(F) > 1 then
      return(ilcm(seq(procname(t[1]^t[2]),t=F)))
    fi;
    a:= [0,0,1];
    for k from 1 do
      a:= [a[2],a[3],2*a[3]+a[2]-a[1] mod n];
      if  a = [0,0,1] then return k fi;
    od:
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Jun 14 2017
  • Mathematica
    Table[FindTransientRepeat[
        Mod[LinearRecurrence[{2, 1, -1}, {0, 0, 1}, 100000], n], 2] //
       Last // Length, {n, 1, 20}]

Formula

From Robert Israel, Jun 14 2017: (Start)
If m and n are coprime, a(m*n) = lcm(a(m),a(n)).
If p is a prime such that the polynomial x^3-x^2-2*x+1 splits into distinct factors mod p, then a(p) divides p-1. These primes are A045472. (End)

Extensions

More terms from Robert Israel, Jun 14 2017

A262773 A Beatty sequence: a(n)=floor(q*n) where q=A231187.

Original entry on oeis.org

0, 2, 4, 6, 8, 11, 13, 15, 17, 20, 22, 24, 26, 29, 31, 33, 35, 38, 40, 42, 44, 47, 49, 51, 53, 56, 58, 60, 62, 65, 67, 69, 71, 74, 76, 78, 80, 83, 85, 87, 89, 92, 94, 96, 98, 101, 103, 105, 107, 110, 112, 114, 116, 119, 121, 123, 125, 128, 130, 132, 134, 137, 139
Offset: 0

Author

Patrick D McLean, Sep 30 2015

Keywords

Comments

Beatty sequence of the longer diagonal (A231187) in a regular heptagon with sidelength 1.
Complement of Beatty sequence A262770 of the longer diagonal (A160389) in a regular heptagon with sidelength 1.

Crossrefs

Complement of A262770.

Programs

  • Mathematica
    Table[Floor[n/(2 Cos[3 Pi/7])], {n, 0, 106}] (* Michael De Vlieger, Oct 05 2015 *)
  • Octave
    q=roots([1,-2,-1,1])(1); a(n)=floor(q*n)
    
  • PARI
    a(n) = floor(n/(2*cos(3*Pi/7))) \\ Michel Marcus, Oct 05 2015

A262770 A Beatty sequence: a(n)=floor(n*p) where p=2*cos(Pi/7)=A160389.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 10, 12, 14, 16, 18, 19, 21, 23, 25, 27, 28, 30, 32, 34, 36, 37, 39, 41, 43, 45, 46, 48, 50, 52, 54, 55, 57, 59, 61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86, 88, 90, 91, 93, 95, 97, 99, 100, 102, 104, 106, 108, 109, 111, 113, 115, 117, 118, 120, 122, 124, 126, 127, 129, 131, 133, 135, 136, 138, 140, 142, 144, 145, 147, 149, 151, 153, 154, 156, 158, 160, 162, 163, 165, 167, 169, 171, 172, 174, 176, 178, 180, 181, 183, 185, 187, 189, 191
Offset: 0

Author

Patrick D McLean, Sep 30 2015

Keywords

Comments

Beatty sequence of the shorter diagonal (A160389) in a regular heptagon with sidelength 1.
Complement of Beatty sequence A262773 of the longer diagonal (A231187) in a regular heptagon with sidelength 1.
First 106 terms agree with A187318, but A187318(106)=190 while A262770(106)=191.

Crossrefs

Complement of A262773.
Initially agrees with A187318 (because 2*cos(Pi/7) is close to 9/5).

Programs

  • Mathematica
    Table[Floor[2 n Cos[Pi/7]], {n, 0, 106}] (* Michael De Vlieger, Oct 05 2015 *)
  • Octave
    p=roots([1,-1,-2,1])(1); a(n)=floor(p*n)
    
  • PARI
    a(n) = floor(n*2*cos(Pi/7)); \\ Michel Marcus, Oct 05 2015

A239526 For 0<=n<=100, a(n) is the number of positive responses x such that x/N rounds to n%, minimized over sample size N.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 3, 1, 3, 2, 3, 4, 1, 5, 3, 5, 2, 3, 4, 6, 1, 10, 6, 4, 3, 3, 7, 2, 7, 5, 3, 4, 5, 6, 7, 10, 17, 1, 18, 11, 8, 7, 6, 5, 4, 7, 10, 3, 11, 5, 5, 7, 11, 19, 2, 13, 9, 7, 5, 13, 8, 14, 3, 13, 10, 7, 11, 4, 13, 9, 5, 16, 11, 6, 7, 7, 8, 9, 10, 11, 13, 15, 18, 22, 28, 39, 66, 1
Offset: 0

Author

Patrick D McLean, Mar 21 2014

Keywords

Examples

			a(31)=4 because 4/13=0.31 (2DP).
		

Crossrefs

Cf. A239525 (Minimal sample sizes).

Programs

  • Mathematica
    Table[LinearProgramming[{1, 0}, {{-n/100 + 0.005, 1}, {n/100 + 0.005, -1}}, {0, 0}, {1, 1}, Integers], {n, 0, 100}] // Transpose // Last
  • Python
    from itertools import count
    def A239526(n):
        for y in count(1):
            x, z = divmod(y*((n<<1)+1),200)
            if not z: return x
            x, z = divmod(y*((n<<1)-1),200)
            if (x:=x+bool(z)) and (200*x+y)//(y<<1) == n:
                return x # Chai Wah Wu, Jun 28 2025

A239525 For 0 <= n <= 100, a(n) is smallest integer N such that some positive x/N rounds to n%, with x > 0.

Original entry on oeis.org

200, 67, 40, 29, 23, 19, 16, 14, 12, 11, 10, 9, 8, 8, 7, 13, 19, 6, 11, 16, 5, 14, 9, 13, 17, 4, 19, 11, 18, 7, 10, 13, 19, 3, 29, 17, 11, 8, 8, 18, 5, 17, 12, 7, 9, 11, 13, 15, 21, 35, 2, 35, 21, 15, 13, 11, 9, 7, 12, 17, 5, 18, 8, 8, 11, 17, 29, 3, 19, 13, 10, 7, 18, 11, 19, 4, 17, 13, 9, 14, 5, 16, 11, 6, 19, 13, 7, 8, 8, 9, 10, 11, 12, 14, 16, 19, 23, 29, 40, 67, 1
Offset: 0

Author

Patrick D McLean, Mar 21 2014

Comments

When the fractional part is 0.5, rounding in either direction is allowed.
From Jonathan Dushoff, Feb 11 2025: (Start)
The sequence arises when considering how to "reverse-engineer" published percentages: A quoted n percent means that proportion was within at least a total of a(n) things.
Having a(n) based on rounding either way when mid-way between two integer percentages makes the terms agnostic as to what rounding was actually used in the published percentage.
(End)

Examples

			a(31)=13 because 4/13 = 0.31 (to two digits after the decimal point).
		

Crossrefs

Cf. A239526 (corresponding x).

Programs

  • Mathematica
    Table[LinearProgramming[{1, 0}, {{-n/100 + 0.005, 1}, {n/100 + 0.005, -1}}, {0, 0}, {1, 1}, Integers], {n, 0, 100}] // Transpose // First
  • Python
    from itertools import count
    def A239525(n):
        for y in count(1):
            if not y*((n<<1)+1)%200: return y
            x, z = divmod(y*((n<<1)-1),200)
            if (a:=x+bool(z)) and (200*a+y)//(y<<1) == n:
                return y # Chai Wah Wu, Jun 28 2025

Formula

Find the smallest N such that there is some x > 0 with abs(100*x/N - n) <= 0.5.

Extensions

Edited by Jonathan Dushoff, Apr 22 2022

A033917 Coefficients of iterated exponential function defined by y(x) = x^y(x) for e^-e < x < e^(1/e), expanded about x=1.

Original entry on oeis.org

1, 1, 2, 9, 56, 480, 5094, 65534, 984808, 16992144, 330667680, 7170714672, 171438170232, 4480972742064, 127115833240200, 3889913061111240, 127729720697035584, 4479821940873927168, 167143865005981109952, 6610411989494027218368, 276242547290322145178880
Offset: 0

Keywords

Comments

a(n) is the n-th derivative of x^(x^...(x^(x^x))) with n x's evaluated at x=1. - Alois P. Heinz, Oct 14 2016

Crossrefs

Row sums of A277536.
Main diagonal of A277537.

Programs

  • Maple
    a:= n-> add(Stirling1(n, k)*(k+1)^(k-1), k=0..n):
    seq(a(n), n=0..25);  # Alois P. Heinz, Aug 31 2012
  • Mathematica
    mx = 20; Table[ i! SeriesCoefficient[ InverseSeries[ Series[ y^(1/y), {y, 1, mx}]], i], {i, 0, n}] (* modified by Robert G. Wilson v, Feb 03 2013 *)
    CoefficientList[Series[-LambertW[-Log[1+x]]/Log[1+x], {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Nov 27 2012 *)
  • PARI
    Stirling1(n, k)=n!*polcoeff(binomial(x, n), k)
    a(n)=local(A=1+x); for(i=1, n, A=sum(m=0, n, sum(k=0, m, Stirling1(m, k)*(A+x*O(x^n))^k)*x^m/m!)); n!*polcoeff(A, n)
    for(n=0,20,print1(a(n),", ")) \\ Paul D. Hanna, Mar 09 2013

Formula

E.g.f.: -LambertW(-log(1+x))/log(1+x). a(n) = Sum_{k=0..n} Stirling1(n, k)*(k+1)^(k-1). - Vladeta Jovovic, Nov 12 2003
a(n) ~ n^(n-1) / ( exp(n -3/2 + exp(-1)/2) * (exp(exp(-1))-1)^(n-1/2) ). - Vaclav Kotesovec, Nov 27 2012
E.g.f.: A(x) satisfies A(x) = Sum_{n>=0} x^n/n! * Sum_{k=0..n} Stirling1(n,k) * A(x)^k. - Paul D. Hanna, Mar 09 2013
a(n) = n! * [x^n] (x+1)^^n. - Alois P. Heinz, Oct 19 2016