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

A190796 Number of digits in the minimal base-phi representation of n.

Original entry on oeis.org

1, 4, 5, 5, 8, 8, 9, 9, 9, 9, 9, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17
Offset: 1

Views

Author

T. D. Noe, May 20 2011

Keywords

Comments

See A130600(n) for the digits in the minimal base phi representation of n.
a(n) <= 2 * ceiling( log(n) / log(phi) ) for n > 1.

References

  • Michel Dekking and Ad van Loon. "On the representation of the natural numbers by powers of the golden mean." Fib. Quart. 61:2 (May 2023), 105-118.

Crossrefs

Programs

  • Mathematica
    nn = 100; len = 2*Ceiling[Log[GoldenRatio, nn]]; Table[d = RealDigits[n, GoldenRatio, len]; last1 = Position[d[[1]], 1][[-1, 1]]; last1, {n, 1, nn}]

Formula

a(n) = A055778(n) + A133775(n).
From Michel Dekking, Jun 19 2024: (Start)
Let (L(n)) = (2, 1, 3, 4, 7, 11, 18, 29, 47, ...) = A000032 be the Lucas numbers.
If L(2n) <= i <= L(2n+1), then a(i) = 4n+1; if L(2n+1)+1 <= i < L(2n+2), then a(i) = 4n+4.
This formula follows from Proposition 4.2. in "On the representation of the natural numbers by powers of the golden mean".
For example if n=1: L(2)=3, L(3)=4, L(4)=7, so a(3) = a(4) = 5, and a(5) = a(6) = 8.
Let (v(n)) = 1,4,5,8,9,12,... be the sequence of values taken by (a(n)). Then it follows directly from the Lucas formula for (a(n)) that v(n) = A042948(n) (where A042948 has been given offset 1, as it should; see also the comment by Jianing Song in A042948).
(End)

A204877 Continued fraction expansion of 3*tanh(1/3).

Original entry on oeis.org

0, 1, 27, 5, 63, 9, 99, 13, 135, 17, 171, 21, 207, 25, 243, 29, 279, 33, 315, 37, 351, 41, 387, 45, 423, 49, 459, 53, 495, 57, 531, 61, 567, 65, 603, 69, 639, 73, 675, 77, 711, 81, 747, 85, 783, 89, 819, 93, 855, 97, 891, 101, 927, 105, 963, 109, 999, 113
Offset: 0

Views

Author

Bruno Berselli, Jan 23 2012

Keywords

Comments

The continued fraction expansions of tanh(1) and 2*tanh(1/2) are in A004273 and A110185, respectively.

Crossrefs

Programs

  • Magma
    I:=[0,1,27,5,63]; [n le 5 select I[n] else 2*Self(n-2)-Self(n-4): n in [1..58]];
    
  • Mathematica
    ContinuedFraction[3 Tanh[1/3], 158]
    CoefficientList[Series[x (1 + 27 x + 3 x^2 + 9 x^3) / ((1 - x)^2 (1 + x)^2), {x, 0, 60}], x] (* Vincenzo Librandi, Jun 14 2013 *)
  • Maxima
    makelist(coeff(taylor(x*(1+27*x+3*x^2+9*x^3)/((1-x)^2*(1+x)^2), x, 0, n), x, n), n, 0, 57);
  • PARI
    \p232;
           contfrac(3*tanh(1/3))
    

Formula

G.f.: x*(1+27*x+3*x^2+9*x^3)/((1-x)^2*(1+x)^2).
E.g.f.: 9-4*exp(-x)*(1+2*x)+5*exp(x)*(-1+2*x).
a(n) = (5+4*(-1)^n)*(2*n-1), with a(0)=0.
a(n) = 2*a(n-2)-a(n-4) for n>4.
a(n) = a(n-2)+A040314(n-2) for n>2.
a(n)*a(n+1) = a(2*n^2).
Sum(a(i), i=0..n) = A195162(A042948(n)).

A215202 Irregular triangle in which n-th row gives m in 1, ..., n-1 such that m^2 == m (mod n).

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 4, 1, 1, 1, 1, 5, 6, 1, 1, 4, 9, 1, 1, 7, 8, 1, 6, 10, 1, 1, 1, 9, 10, 1, 1, 5, 16, 1, 7, 15, 1, 11, 12, 1, 1, 9, 16, 1, 1, 13, 14, 1, 1, 8, 21, 1, 1, 6, 10, 15, 16, 21, 25, 1, 1, 1, 12, 22, 1, 17, 18, 1, 15, 21, 1, 9, 28, 1, 1, 19, 20, 1, 13
Offset: 2

Views

Author

Eric M. Schmidt, Aug 05 2012

Keywords

Comments

The n-th row has length A034444(n) - 1.
If m appears in row n, then gcd(n,m) appears in the n-th row of A077610. Moreover, if m', distinct from m, also appears in row n, then gcd(n, m) does not equal gcd(n, m').
For odd n and any integer m, m^2 == m (mod n) iff m^2 == m (mod 2n).
Let P(1)={1} and for integers x > 1, let P(x) be the set of distinct prime divisors of x. We can define an equivalence relation ~ on the set of elements in the ring (Z_n, +mod n,*mod n): for all a,b in Z_n (where a,b are the least nonnegative residues modulo n) a ~ b iff P(gcd(a,n)) intersect P(n) is equal to P(gcd(b,n)) intersect P(n). If we include 0 in each row then these elements can represent the equivalence classes. They form a commutative monoid. - Geoffrey Critzer, Feb 13 2016

Examples

			Triangle begins:
1;
1;
1;
1;
1, 3, 4;
1;
1;
1;
1, 5, 6;
1;
1, 4, 9;
1;
1, 7, 8;
1, 6, 10;
1;
1;
1, 9, 10; etc.  - _Bruno Berselli_, Aug 06 2012
		

Crossrefs

For m^2 == m (mod n), see: n=2: A001477; n=3: A032766; n=4: A042948; n=5: A008851; n=6: A032766; n=7: A047274; n=8: A047393; n=9: A090570; n=10: A008851; n=11: A112651; n=12: A112652; n=13: A112653; n=14: A047274; n=15: A151972; n=16: A151977; n=17: A151978; n=18: A090570; n=19: A151979; n=20: A151980; n=21: A151971; n=22: A112651; n=24: A151973; n=26: A112653; n=30: A151972; n=32: A151983; n=34: A151978; n=38: A151979; n=42: A151971; n=48: A151981; n=64: A151984; n=100: A008852; n=1000: A008853.

Programs

  • Magma
    [m: m in [1..n-1], n in [2..40] | m^2 mod n eq m]; // Bruno Berselli, Aug 06 2012
  • Mathematica
    Table[Select[Range[n], Mod[#^2, n] == # &], {n, 2, 30}] // Grid (* Geoffrey Critzer, May 26 2015 *)
  • Sage
    def A215202(n) : return [m for m in range(1, n) if m^2 % n == m];
    

A276914 Subsequence of triangular numbers obtained by adding a square and two smaller triangles, a(n) = n^2 + 2*A000217(A052928(n)).

Original entry on oeis.org

0, 1, 10, 15, 36, 45, 78, 91, 136, 153, 210, 231, 300, 325, 406, 435, 528, 561, 666, 703, 820, 861, 990, 1035, 1176, 1225, 1378, 1431, 1596, 1653, 1830, 1891, 2080, 2145, 2346, 2415, 2628, 2701, 2926, 3003, 3240, 3321, 3570, 3655, 3916, 4005, 4278, 4371, 4656
Offset: 0

Views

Author

Daniel Poveda Parrilla, Sep 22 2016

Keywords

Comments

All terms of this sequence are triangular numbers. Graphically, for each term of the sequence, one corner of the square will be part of the corresponding triangle's hypotenuse if the term is an odd number. Otherwise, it will not be part of it.
a(A276915(n)) is a triangular pentagonal number.
a(A079291(n)) is a triangular square number, as A275496 is a subsequence of this.

Crossrefs

Programs

  • Magma
    [n*(2*n+(-1)^n): n in [0..40]]; // G. C. Greubel, Aug 19 2022
    
  • Mathematica
    Table[n (2 n + (-1)^n), {n, 0, 48}] (* Michael De Vlieger, Sep 23 2016 *)
  • PARI
    concat(0, Vec(x*(1+9*x+3*x^2+3*x^3)/((1-x)^3*(1+x)^2) + O(x^50))) \\ Colin Barker, Sep 23 2016
    
  • SageMath
    [n*(2*n+(-1)^n) for n in (0..40)] # G. C. Greubel, Aug 19 2022

Formula

a(n) = n^2 + 2*A000217(A052928(n)).
a(n) = A000217(A042948(n)).
a(n) = n*(2*n + (-1)^n).
a(n) = n*A168277(n + 1).
a(n) = n*A016813(A004526(n)).
From Colin Barker, Sep 23 2016: (Start)
G.f.: x*(1 + 9*x + 3*x^2 + 3*x^3) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
a(n) = n*(2*n+1) for n even.
a(n) = n*(2*n-1) for n odd. (End)
E.g.f.: x*( 2*(1+x)*exp(x) - exp(-x) ). - G. C. Greubel, Aug 19 2022
Sum_{n>=1} 1/a(n) = 2 - log(2). - Amiram Eldar, Aug 21 2022

A292576 Permutation of the natural numbers partitioned into quadruples [4k-1, 4k-3, 4k-2, 4k], k > 0.

Original entry on oeis.org

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

Views

Author

Guenther Schrack, Sep 19 2017

Keywords

Comments

Partition the natural number sequence into quadruples starting with (1,2,3,4); swap the second and third elements, then swap the first and the second element; repeat for all quadruples.

Crossrefs

Inverse: A056699(n+1) - 1 for n > 0.
Sequence of fixed points: A008586(n) for n > 0.
Subsequences:
elements with odd index: A042964(A103889(n)) for n > 0.
elements with even index: A042948(n) for n > 0.
odd elements: A166519(n) for n>0.
indices of odd elements: A042963(n) for n > 0.
even elements: A005843(n) for n>0.
indices of even elements: A014601(n) for n > 0.
Sum of pairs of elements:
a(n+2) + a(n) = A163980(n+1) = A168277(n+2) for n > 0.
Difference between pairs of elements:
a(n+2) - a(n) = (-1)^A011765(n+3)*A091084(n+1) for n > 0.
Compound relations:
a(n) = A284307(n+1) - 1 for n > 0.
a(n+2) - 2*a(n+1) + a(n) = (-1)^A011765(n)*A132400(n+1) for n > 0.
Compositions:
a(n) = A116966(A080412(n)) for n > 0.
a(A284307(n)) = A256008(n) for n > 0.
a(A042963(n)) = A166519(n-1) for n > 0.
A256008(a(n)) = A056699(n) for n > 0.

Programs

  • MATLAB
    a = [3 1 2 4]; % Generate b-file
    max = 10000;
    for n := 5:max
       a(n) = a(n-4) + 4;
    end;
    
  • PARI
    for(n=1, 10000, print1(n + ((-1)^(n*(n-1)/2)*(2 - (-1)^n) - (-1)^n)/2, ", "))

Formula

a(1)=3, a(2)=1, a(3)=2, a(4)=4, a(n) = a(n-4) + 4 for n > 4.
O.g.f.: (2*x^3 + x^2 - 2*x + 3)/(x^5 - x^4 - x + 1).
a(n) = n + ((-1)^(n*(n-1)/2)*(2-(-1)^n) - (-1)^n)/2.
a(n) = n + (cos(n*Pi/2) - cos(n*Pi) + 3*sin(n*Pi/2))/2.
a(n) = n + n mod 2 + (ceiling(n/2)) mod 2 - 2*(floor(n/2) mod 2).
Linear recurrence: a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
First Differences, periodic: (-2, 1, 2, 3), repeat; also (-1)^A130569(n)*A068073(n+2) for n > 0.

A104569 Triangle read by rows: T(i,j) is the (i,j)-entry (1 <= j <= i) of the product Q*R of the infinite lower triangular matrices Q = [1; 1,3; 1,3,1; 1 3,1,3; ...] and R = [1; 1,1; 1,1,1; 1,1,1,1; ...].

Original entry on oeis.org

1, 4, 3, 5, 4, 1, 8, 7, 4, 3, 9, 8, 5, 4, 1, 12, 11, 8, 7, 4, 3, 13, 12, 9, 8, 5, 4, 1, 16, 15, 12, 11, 8, 7, 4, 3, 17, 16, 13, 12, 9, 8, 5, 4, 1, 20, 19, 16, 15, 12, 11, 8, 7, 4, 3, 21, 20, 17, 16, 13, 12, 9, 8, 5, 4, 1, 24, 23, 20, 19, 16, 15, 12, 11, 8, 7, 4, 3, 25, 24, 21, 20, 17, 16, 13, 12, 9, 8, 5, 4, 1
Offset: 1

Views

Author

Gary W. Adamson, Mar 16 2005

Keywords

Examples

			The first few rows of the triangle are:
  1;
  4, 3;
  5, 4, 1;
  8, 7, 4, 3;
  9, 8, 5, 4, 1;
  ...
		

Crossrefs

Row sums yield A074377. Columns 1, 3, 5, ... (starting at the diagonal entry) yield A042948. Columns 2, 4, 6, ... (starting at the diagonal entry) yield A014601. The product R*Q yields A104570.

Programs

  • Maple
    T:=proc(i,j) if j>i then 0 elif i+j mod 2 = 1 then 2*(i-j)+2 elif i mod 2 = 1 and j mod 2 = 1 then 2*(i-j)+1 elif i mod 2 = 0 and j mod 2 = 0 then 2*(i-j)+3 else fi end: for i from 1 to 13 do seq(T(i,j),j=1..i) od; # yields sequence in triangular form # Emeric Deutsch, Mar 23 2005
  • Mathematica
    Q[i_, j_] := If[j <= i, 2 + (-1)^j, 0];
    R[i_, j_] := If[j <= i, 1, 0];
    T[i_, j_] := Sum[Q[i, k]*R[k, j], {k, 1, 13}];
    Table[T[i, j], {i, 1, 13}, {j, 1, i}] // Flatten (* Jean-François Alcover, Jul 24 2024 *)

Formula

For 1<=j<=i: T(i, j)=2(i-j+1) if i and j are of opposite parity; T(i, j)=2(i-j)+1 if both i and j are odd; T(i, j)=2(i-j)+3 if both i and j are even. - Emeric Deutsch, Mar 23 2005

Extensions

More terms from Emeric Deutsch, Mar 23 2005

A136489 Triangle T(n, k) = 3*A007318(n, k) - 2*A034851(n, k).

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 5, 5, 1, 1, 8, 10, 8, 1, 1, 9, 18, 18, 9, 1, 1, 12, 27, 40, 27, 12, 1, 1, 13, 39, 67, 67, 39, 13, 1, 1, 16, 52, 112, 134, 112, 52, 16, 1, 1, 17, 68, 164, 246, 246, 164, 68, 17, 1, 1, 20, 85, 240, 410, 504, 410, 240, 85, 20, 1
Offset: 0

Views

Author

Gary W. Adamson, Jan 01 2008

Keywords

Examples

			First few rows of the triangle are:
  1;
  1,   1;
  1,   4,   1;
  1,   5,   5,   1;
  1,   8,  10,   8,   1;
  1,   9,  18,  18,   9,   1;
  1,  12,  27,  40,  27,  12,   1;
  1,  13,  39,  67,  67,  39,  13,   1;
  1,  16,  52, 112, 134, 112,  52,  16,   1;
  1,  17,  68, 164, 246, 246, 164,  68,  17,   1;
  ...
		

Crossrefs

Cf. A034851, A042948, A077957, A122746 (row sums).

Programs

  • Magma
    A136489:= func< n,k | 2*Binomial(n,k) - Binomial(n mod 2, k mod 2)*Binomial(Floor(n/2), Floor(k/2)) >;
    [A136489(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Aug 01 2023
    
  • Mathematica
    T[n_, k_]:= 2*Binomial[n,k] -Binomial[Mod[n,2], Mod[k,2]]*Binomial[Floor[n/2], Floor[k/2]];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Aug 01 2023 *)
  • SageMath
    def A136489(n,k): return 2*binomial(n,k) - binomial(n%2, k%2)*binomial(n//2, k//2)
    flatten([[A136489(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Aug 01 2023

Formula

T(n, k) = 3*A007318(n, k) - 2*A034851(n, k).
Sum_{k=0..n} T(n, k) = A122746(n).
From G. C. Greubel, Aug 01 2023: (Start)
T(n, k) = 2*A007318(n, k) - A051159(n, k).
T(n, k) = T(n-1, k) + T(n-1, k-1) if k is even.
T(n, n-k) = T(n, k).
T(n, n-1) = A042948(n).
Sum_{k=0..n} (-1)^k * T(n, k) = 2*[n=0] - A077957(n). (End)

A171507 a(n) = (5*2^(n+1)-9-(-1)^n)/6-2*n.

Original entry on oeis.org

0, 0, 1, 6, 17, 42, 93, 198, 409, 834, 1685, 3390, 6801, 13626, 27277, 54582, 109193, 218418, 436869, 873774, 1747585, 3495210, 6990461, 13980966, 27961977, 55924002, 111848053, 223696158, 447392369, 894784794, 1789569645, 3579139350, 7158278761, 14316557586
Offset: 0

Views

Author

Paul Curtz, Dec 10 2009

Keywords

Crossrefs

Programs

Formula

a(n) = 3*a(n-1)-a(n-2)-3*a(n-3)+2*a(n-4). G.f.: x^2*(1+3*x)/((1+x)*(1-2*x)*(1-x)^2).
a(n) = A084640(n) - A042948(n).
a(n+1)-2*a(n) = A042948(n+1).
First differences: a(n+1)-a(n) = A084640(n).
Last digits: a(n) == a(n+10) (mod 10), n>=1.

Extensions

Edited and extended by R. J. Mathar, Dec 15 2009

A267089 T(n,k) is decimal conversion of 1's in an n X n table that lie on its principal diagonals.

Original entry on oeis.org

1, 3, 3, 5, 2, 5, 9, 6, 6, 9, 17, 10, 4, 10, 17, 33, 18, 12, 12, 18, 33, 65, 34, 20, 8, 20, 34, 65, 129, 66, 36, 24, 24, 36, 66, 129, 257, 130, 68, 40, 16, 40, 68, 130, 257, 513, 258, 132, 72, 48, 48, 72, 132, 258, 513, 1025, 514, 260, 136, 80, 32, 80, 136, 260, 514
Offset: 0

Views

Author

Kival Ngaokrajang, Jan 10 2016

Keywords

Comments

Inspired by A137932 and A042948.
Conjectures:
(i) The first column is A083318.
(ii) T(n,k) = A086066(m) where m >= 10, n = m - 9*k, k = floor(m/10).

Examples

			See the "Illustration of initial terms" link for explicit examples.
Triangle begins:
n\k 0   1  2  3  4  5  6   7   8 ...
0   1
1   3   3
2   5   2  5
3   9   6  6  9
4  17  10  4 10 17
5  33  18 12 12 18 33
6  65  34 20  8 20 34 65
7 129  66 36 24 24 36 66 129
8 257 130 68 40 16 40 68 130 257
...
		

Crossrefs

A267489 a(n) = n^2 - 4*floor(n^2/6).

Original entry on oeis.org

0, 1, 4, 5, 8, 9, 12, 17, 24, 29, 36, 41, 48, 57, 68, 77, 88, 97, 108, 121, 136, 149, 164, 177, 192, 209, 228, 245, 264, 281, 300, 321, 344, 365, 388, 409, 432, 457, 484, 509, 536, 561, 588, 617, 648, 677, 708, 737, 768, 801, 836, 869, 904
Offset: 0

Views

Author

Kival Ngaokrajang, Jan 16 2016

Keywords

Comments

Inspired by A137932 and A042948.
The pattern is generated by adding subdiagonals parallel to principal diagonals at a spacing of at least 1 box in any direction from the previous generation.
Conjectures:
(i) a(n) is the total number of boxes (or 1's) at the n-th iteration.
(ii) The total number of left boxes (or 0's) is 4*A056827.

Crossrefs

Programs

  • Magma
    [0] cat [n^2-4*Floor(n^2/6): n in [1..70]]; // Vincenzo Librandi, Jan 16 2016
  • Maple
    A267489:=n->n^2-4*floor(n^2/6): seq(A267489(n), n=0..100); # Wesley Ivan Hurt, Apr 11 2017
  • Mathematica
    Table[n^2 - 4 Floor[n^2 / 6], {n, 0, 70}] (* Vincenzo Librandi, Jan 16 2016 *)
  • PARI
    for (n = 0, 100, a = n^2-4*floor(n^2/6); print1(a, ", "))
    
  • PARI
    concat(0, Vec(x*(1+2*x-2*x^2+2*x^3-2*x^4+2*x^5+x^6)/((1-x)^3*(1+x)*(1-x+x^2)*(1+x+x^2)) + O(x^100))) \\ Colin Barker, Jan 16 2016
    
  • PARI
    a(n)=n^2 - n^2\6*4 \\ Charles R Greathouse IV, Mar 22 2017
    

Formula

a(n) = n^2 - 4*floor(n^2/6) for n >= 0.
From Colin Barker, Jan 16 2016: (Start)
a(n) = 2*a(n-1) - a(n-2) + a(n-6) - 2*a(n-7) + a(n-8) for n>7.
G.f.: x*(1+2*x-2*x^2+2*x^3-2*x^4+2*x^5+x^6) / ((1-x)^3*(1+x)*(1-x+x^2)*(1+x+x^2)).
(End)
Previous Showing 41-50 of 77 results. Next