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

A244587 a(n) = n OR 5.

Original entry on oeis.org

5, 5, 7, 7, 5, 5, 7, 7, 13, 13, 15, 15, 13, 13, 15, 15, 21, 21, 23, 23, 21, 21, 23, 23, 29, 29, 31, 31, 29, 29, 31, 31, 37, 37, 39, 39, 37, 37, 39, 39, 45, 45, 47, 47, 45, 45, 47, 47, 53, 53, 55, 55, 53, 53, 55, 55, 61, 61, 63, 63, 61, 61, 63, 63, 69, 69, 71, 71
Offset: 0

Views

Author

Gary Detlefs, Jun 30 2014

Keywords

Crossrefs

Cf. similar sequences of the type n OR k: A109613 (k=1), A174091 (k=2), A244584 (k=3), A244586 (k=4), this sequence (k=5), A244588 (k=6).

Programs

  • Magma
    [BitwiseOr(n, 5): n in [0..80]]; // Bruno Berselli, Jul 01 2014
    
  • Maple
    with(Bits): seq(Or(n,5), n = 0..60);
  • PARI
    a(n) = bitor(n, 5); \\ Michel Marcus, Jan 19 2023
  • Python
    def A244587(n): return n|5 # Chai Wah Wu, Jan 18 2023
    

Formula

a(n) = (n+5) - (n AND 5).
a(n) = (n XOR 5) + (n AND 5).
a(n) = n +((n+1) mod 2)+4*floor(((n+4) mod 8)/4).
a(n) = (2*n + 4*(-1)^floor(n/4) + (-1)^n + 5)/2. - Bruno Berselli, Jul 01 2014
G.f.: (x^6+x^4-3*x^2+5)/((x+1)*(x^4+1)*(x-1)^2). - Alois P. Heinz, Jul 01 2014

Extensions

Some terms corrected by Bruno Berselli, Jul 01 2014

A295609 a(n) = least prime number p such that p AND n = n (where AND denotes the binary AND operator).

Original entry on oeis.org

2, 3, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 31, 31, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 31, 31, 29, 29, 31, 31, 37, 37, 43, 43, 37, 37, 47, 47, 41, 41, 43, 43, 47, 47, 47, 47, 53, 53, 59, 59, 53, 53, 127, 127, 59, 59, 59, 59, 61, 61, 127, 127, 67, 67
Offset: 0

Views

Author

Rémy Sigrist, Nov 24 2017

Keywords

Comments

For any n > 0: gcd(A109613(n), A062383(n)) = 1, hence, by Dirichlet's theorem on arithmetic progressions, we have a prime number, say p, of the form A109613(n) + k * A062383(n) with k > 0; this prime number satisfies p AND n = n; also a(0) = 2, hence the sequence is well defined for any n >= 0.
a(n) = n iff n is prime.
Each prime number appears 2*k times in this sequence for some k > 0.

Examples

			a(42) = 42 + A295335(42) = 42 + 1 = 43.
		

Crossrefs

Programs

  • Mathematica
    Table[Block[{p = 2}, While[BitAnd[p, n] != n, p = NextPrime@ p]; p], {n, 0, 65}] (* Michael De Vlieger, Nov 26 2017 *)
  • PARI
    avoid(n,i) = if (i, if (n%2, 2*avoid(n\2,i), 2*avoid(n\2,i\2)+(i%2)), 0) \\ (i+1)-th number k such that k AND n = 0
    a(n) = for (i=0, oo, my (k=avoid(n,i)); if (isprime(n+k), return (n+k)))

Formula

a(n) = n + A295335(n).
For any k > 1, a(2*k) = a(2*k+1).

A372601 The maximal exponent in the prime factorization of the largest exponentially odd divisor of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Amiram Eldar, May 07 2024

Keywords

Comments

First differs from A331273 at n = 64.
Differs from A363332 at n = 1, 216, 432, 648, 864, 1000, ... .

Crossrefs

Programs

  • Mathematica
    f[n_] := n - If[EvenQ[n], 1, 0]; a[n_] := f[Max[FactorInteger[n][[;; , 2]]]]; a[1] = 0; Array[a, 100]
  • PARI
    s(n) = (n+1) \ 2 * 2 - 1;
    a(n) = if(n>1, s(vecmax(factor(n)[,2])), 0);

Formula

a(n) = A051903(A350390(n)).
a(n) = A109613(A051903(n)-1) for n >= 2.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1 + 2 * Sum_{i>=1} (1 - (1/zeta(2*i+1))) = 1.42929441950714075659... .

A168276 a(n) = 2*n - (-1)^n - 1.

Original entry on oeis.org

2, 2, 6, 6, 10, 10, 14, 14, 18, 18, 22, 22, 26, 26, 30, 30, 34, 34, 38, 38, 42, 42, 46, 46, 50, 50, 54, 54, 58, 58, 62, 62, 66, 66, 70, 70, 74, 74, 78, 78, 82, 82, 86, 86, 90, 90, 94, 94, 98, 98, 102, 102, 106, 106, 110, 110, 114, 114, 118, 118, 122, 122, 126, 126, 130, 130
Offset: 1

Views

Author

Vincenzo Librandi, Nov 22 2009

Keywords

Crossrefs

Cf. A063210. - R. J. Mathar, Nov 25 2009

Programs

  • Magma
    [2*n-1-(-1)^n: n in [1..70]]; // Vincenzo Librandi, Sep 16 2013
  • Mathematica
    CoefficientList[Series[2 (1 + x^2) / ((1 + x) (1 - x)^2), {x, 0, 80}], x] (* Vincenzo Librandi, Sep 16 2013 *)
    Table[2 n - 1 - (-1)^n, {n, 70}] (* Bruno Berselli, Sep 17 2013 *)
    LinearRecurrence[{1,1,-1},{2,2,6},70] (* Harvey P. Dale, Oct 22 2014 *)

Formula

a(n) = 4*n - a(n-1) - 4, with n>1, a(1)=2.
from R. J. Mathar, Nov 25 2009: (Start)
a(n) = 2*n - (-1)^n - 1.
a(n) = 2*A109613(n-1).
G.f.: 2*x*(1 + x^2)/((1+x)*(1-x)^2). (End)
a(n) = a(n-1) + a(n-2) - a(n-3). - Vincenzo Librandi, Sep 16 2013
a(n) = A168277(n) + 1. - Vincenzo Librandi, Sep 17 2013
E.g.f.: (-1 + 2*exp(x) + (2*x -1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
Sum_{n>=1} 1/a(n)^2 = Pi^2/16. - Amiram Eldar, Aug 21 2022

Extensions

Previous definition replaced with closed-form expression by Bruno Berselli, Sep 17 2013

A168329 a(n) = (3/2)*(2*n - (-1)^n - 1).

Original entry on oeis.org

3, 3, 9, 9, 15, 15, 21, 21, 27, 27, 33, 33, 39, 39, 45, 45, 51, 51, 57, 57, 63, 63, 69, 69, 75, 75, 81, 81, 87, 87, 93, 93, 99, 99, 105, 105, 111, 111, 117, 117, 123, 123, 129, 129, 135, 135, 141, 141, 147, 147, 153, 153, 159, 159, 165, 165, 171, 171, 177, 177, 183, 183
Offset: 1

Views

Author

Vincenzo Librandi, Nov 23 2009

Keywords

Crossrefs

Programs

  • Magma
    [(3/2)*(2*n-(-1)^n-1): n in [1..70]]; // Vincenzo Librandi, Nov 15 2011
  • Mathematica
    LinearRecurrence[{1,1,-1},{3,3,9},80 ] (* Vincenzo Librandi, Nov 15 2011 *)
    Table[(3/2) (2 n - (-1)^n - 1), {n, 70}] (* Bruno Berselli, Sep 17 2013 *)

Formula

a(n) = 6*n - a(n-1) - 6 for n>1, a(1)=3.
G.f.: 3*x*(1 + x^2)/((1+x)*(1-x)^2). - Bruno Berselli, Nov 06 2011
a(n) = -a(-n+1) = 3*A109613(n-1) = A198392(n-1) - A198392(-n). - Bruno Berselli, Nov 06 2011 - Sep 17 2013
E.g.f.: (3/2)*(-1 + 2*exp(x) + (2*x - 1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 18 2016

Extensions

New definition by Bruno Berselli, Sep 17 2013

A181878 Coefficient array for square of Chebyshev S-polynomials.

Original entry on oeis.org

1, 1, 1, -2, 1, 4, -4, 1, 1, -6, 11, -6, 1, 9, -24, 22, -8, 1, 1, -12, 46, -62, 37, -10, 1, 16, -80, 148, -128, 56, -12, 1, 1, -20, 130, -314, 367, -230, 79, -14, 1, 25, -200, 610, -920, 771, -376, 106, -16, 1, 1, -30, 295, -1106, 2083, -2232, 1444, -574, 137, -18, 1, 36, -420, 1897, -4352, 5776, -4744, 2486, -832, 172, -20, 1, 1, -42, 581, -3108, 8518, -13672, 13820, -9142, 4013, -1158, 211, -22, 1
Offset: 0

Views

Author

Wolfdieter Lang, Dec 22 2010

Keywords

Comments

For the coefficients of Chebyshev polynomials S(n,x) see A049310.
The row length sequence for this array is A109613 = {1,1,3,3,5,5,...}.
The row polynomials (in x^2) for even row numbers are
S(2*k,x)^2 = Sum_{m=0..2*k} a(2*k,m)*x^(2*m), k >= 0.
For odd row numbers the row polynomials (in x^2) are
(S(2*k+1,x)^2)/x^2 = Sum_{m=0..2*k} a(2*k+1,m)*x^(2*m), k >= 0.
The o.g.f. for the polynomials S(n,x)^2 is
S(x,z):=((1+z)/(1-z))/(1 + (2-x^2)z +z^2). See the link for a proof. Therefore the coefficients constitute the Riordan array (1/(1-x^2),x/(1+x)^2) found as A158454.
The o.g.f. for S(2*k,sqrt(x))^2 is
(1-2*(1-x)*z+z^2)/((1-z)*(1 - (2-4*x+x^2)*z + z^2)).
The o.g.f. for (S(2*k+1,sqrt(x))^2)/x is
((1+z)/(1-z))/(1 - (2-4*x+x^2)*z + z^2).
The row sums A011655(n+1) are the same as those for the triangle A158454.
The alternating row sums for even numbered rows (-1)^n*A007598(n+1) coincide with those of triangle A158454. For odd row numbers n=2k+1 these sums are A049684(k+1), k >= 0 (squares of even-indexed Fibonacci numbers).

Examples

			The irregular triangle a(n,m) begins:
  n\m  0    1    2      3     4      5     6    7   8   9  10 ...
  0:   1
  1:   1
  2:   1   -2    1
  3:   4   -4    1
  4:   1   -6   11     -6     1
  5:   9  -24   22     -8     1
  6:   1  -12   46    -62    37    -10     1
  7:  16  -80  148   -128    56    -12     1
  8:   1  -20  130   -314   367   -230    79  -14   1
  9:  25 -200  610   -920   771   -376   106  -16   1
  10:  1  -30  295  -1106  2083  -2232  1444 -574 137 -18   1
  ... Reformatted and extended by _Wolfdieter Lang_, Nov 24 2012
		

Crossrefs

Programs

  • Mathematica
    Join[{{1}, {1}}, CoefficientList[Table[ChebyshevU[n, Sqrt[x]/2]^2, {n, 2, 10}], x]] // Flatten (* Eric W. Weisstein, Apr 04 2018 *)
    Join[{{1}, {1}}, CoefficientList[ChebyshevU[Range[2, 10], Sqrt[x]/2]^2, x]]  // Flatten (* Eric W. Weisstein, Apr 04 2018 *)

Formula

a(2*k,m) = (-1)^m*Sum_{j=0..k} binomial(2*k+m-1-2*j, 2*m-1), k >= 0.
a(2*k+1,m) = (-1)^m*Sum_{j=0..k} binomial(2*k+1+m-2*j, 2*m+1), k >= 0.
This derives from the formula for the entries of the Riordan array A158454.
For the o.g.f.s see the comment.

Extensions

Corrected by Wolfdieter Lang, Jan 21 2011

A215495 a(4*n) = a(4*n+2) = a(2*n+1) = 2*n + 1.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 3, 7, 5, 9, 5, 11, 7, 13, 7, 15, 9, 17, 9, 19, 11, 21, 11, 23, 13, 25, 13, 27, 15, 29, 15, 31, 17, 33, 17, 35, 19, 37, 19, 39, 21, 41, 21, 43, 23, 45, 23, 47, 25, 49, 25, 51, 27, 53, 27, 55, 29, 57, 29, 59, 31, 61, 31, 63, 33, 65, 33, 67, 35, 69, 35, 71, 37, 73, 37, 75, 39, 77, 39, 79, 41, 81, 41, 83, 43, 85, 43
Offset: 0

Views

Author

Paul Curtz, Aug 13 2012

Keywords

Comments

A214282(n) and -A214283(n) are companions. Separately or together, they have many links with the Catalan's numbers A000108(n). Examples:
A214282(n+1) - 2*A214282(n) = -1, -1, 1, 0, -2, -5, 5, 0, -14, -42, 42, 0, -132, ....
2*A214283(n) - A214283(n+1) = 1, 0, -1, -2, 2, 0, -5, -14, 14, 0, -42, -132, 132, ....
A214282(n) + A214283(n) = 1, 0, -1, 0, 2, 0, -5, 0, 14, 0, -42,... (A126120).
The companion to a(n) is b(n) = -A214283(n)/(1,1,1,1,2,2,5,5,...) = 0, 1, 2, 3, 2, 5, 4, 7, 4, 9, 6, ....
a(n) - b(n) = A056594(n).
Discovered as a(n) = A214282(n+1)/A000108([n/2]). See abs(A129996(n-2)).

Crossrefs

Programs

  • Magma
    I:=[1,1,1,3,3,5]; [n le 6 select I[n] else Self(n-2) +Self(n-4) -Self(n-6): n in [1..30]]; // G. C. Greubel, Apr 23 2018
  • Mathematica
    a[n_?EvenQ] := n/2 + Boole[Mod[n, 4] == 0]; a[n_?OddQ] := n; Table[a[n], {n, 0, 86}] (* Jean-François Alcover, Aug 14 2012 *)
    LinearRecurrence[{0,1,0,1,0,-1}, {1,1,1,3,3,5}, 50] (* G. C. Greubel, Apr 23 2018 *)
  • PARI
    x='x+O('x^30); Vec(( 1+x+2*x^3+x^4+x^5 )/( (x^2+1)*(x-1)^2*(1+x)^2 )) \\ G. C. Greubel, Apr 23 2018
    

Formula

a(n+3) = (A185048(n+3)=2,2,4,2,... ) + 1.
a(n+2) - a(n) = 0, 2, 2, 2. (Period 4).
a(n) = 2*a(n-4) - a(n-8).
a(2*n) = A109613(n).
a(n+1) - a(n) = 2* (-1)^n * A059169(n).
G.f. : ( 1+x+2*x^3+x^4+x^5 ) / ( (x^2+1)*(x-1)^2*(1+x)^2 ). - Jean-François Alcover, Aug 14 2012

A230584 Either two less than a square or two more than a square.

Original entry on oeis.org

2, 3, 6, 7, 11, 14, 18, 23, 27, 34, 38, 47, 51, 62, 66, 79, 83, 98, 102, 119, 123, 142, 146, 167, 171, 194, 198, 223, 227, 254, 258, 287, 291, 322, 326, 359, 363, 398, 402, 439, 443, 482, 486, 527, 531, 574, 578, 623, 627, 674, 678, 727, 731, 782, 786, 839, 843, 898, 902, 959, 963
Offset: 1

Views

Author

Ralf Stephan, Oct 24 2013

Keywords

Comments

Numbers n such that the polynomial x^4 - n*x^2 + 1 is reducible.
The corresponding factorizations are (x^2 + k*x - 1)*(x^2 - k*x - 1) == x^4 - (k^2 + 2)*x^2 + 1 and (x^2 + k*x + 1)*(x^2 - k*x + 1) == x^4 - (k^2 - 2)*x^2 + 1. - Joerg Arndt, Feb 07 2015
Union of A008865 and A059100.
For k > 1: a(2*k+1) - a(2*k) = 4 and a(2*k) - a(2*k-1) = k - 1; for n > 4: a(n) - a(n-2) = 2*floor(n/2) + 1 = A109613(n). - Reinhard Zumkeller, Feb 10 2015

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a230584 n = a230584_list !! (n-1)
    a230584_list = 2 : 3 : concat
                   (transpose [drop 2 a059100_list, drop 2 a008865_list])
    -- Reinhard Zumkeller, Feb 10 2015
  • PARI
    is(n)=issquare(n-2)||issquare(n+2)
    
  • PARI
    A230584_vec(N)=Vec((2+x-x^2-x^3+2*x^5-x^6)/((1-x)^3*(1+x)^2)+O(x^N)) \\ M. F. Hasler, Oct 26 2013
    

Formula

From Colin Barker, Oct 24 2013: (Start)
a(n) = (5-13*(-1)^n+2*(3+(-1)^n)*n+2*n^2)/8 for n>2.
a(n) = (n^2+4*n-4)/4 for n>2 and even.
a(n) = (n^2+2*n+9)/4 for n>2 and odd.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5) for n>7.
G.f.: x*(x^6-2*x^5+x^3+x^2-x-2) / ((x-1)^3*(x+1)^2). (End)
After the first two terms 0^2+2 = 2^2-2, 1^2+2, the squares are sufficiently spaced to ensure that the sequence continues 2^2+2, 3^2-2, 3^2+2, 4^2-2, 4^2+2,..., i.e., a(2n-1) = n^2+2, a(2n)=(n+1)^2-2. - M. F. Hasler, Oct 26 2013

A238303 Triangle T(n,k), 0<=k<=n, read by rows given by T(n,0) = 1, T(n,k) = 2 if k>0.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Feb 24 2014

Keywords

Comments

Row sums are A005408(n).
Diagonals sums are A109613(n).
Sum_{k=0..n} T(n,k)*x^k = A033999(n), A000012(n), A005408(n), A036563(n+2), A058481(n+1), A083584(n), A137410(n), A233325(n), A233326(n), A233328(n), A211866(n+1), A165402(n+1) for x = -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 respectively.
Sum_{k=0..n} T(n,k)*x^(n-k) = A151575(n), A000012(n), A040000(n), A005408(n), A033484(n), A048473(n), A020989(n), A057651(n), A061801(n), A238275(n), A238276(n), A138894(n), A090843(n), A199023(n) for x = -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 respectively.
Sum_{k=0..n} T(n,k)^x = A000027(n+1), A005408(n), A016813(n), A017077(n) for x = 0, 1, 2, 3 respectively.
Sum_{k=0..n} k*T(n,k) = A002378(n).
Sum_{k=0..n} A000045(k)*T(n,k) = A019274(n+2).
Sum_{k=0..n} A000142(k)*T(n,k) = A066237(n+1).

Examples

			Triangle begins:
1;
1, 2;
1, 2, 2;
1, 2, 2, 2;
1, 2, 2, 2, 2;
1, 2, 2, 2, 2, 2;
1, 2, 2, 2, 2, 2, 2;
1, 2, 2, 2, 2, 2, 2, 2;
1, 2, 2, 2, 2, 2, 2, 2, 2;
1, 2, 2, 2, 2, 2, 2, 2, 2, 2;
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2;
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2;
...
		

Crossrefs

Cf. Diagonals: A040000.
Cf. Columns: A000012, A007395.
First differences of A001614.

Programs

Formula

T(n,0) = A000012(n) = 1, T(n+k,k) = A007395(n) = 2 for k>0.

Extensions

Data section extended to a(104) by Antti Karttunen, Jan 19 2025

A289296 a(n) = (n - 1)*(2*floor(n/2) + 1).

Original entry on oeis.org

-1, 0, 3, 6, 15, 20, 35, 42, 63, 72, 99, 110, 143, 156, 195, 210, 255, 272, 323, 342, 399, 420, 483, 506, 575, 600, 675, 702, 783, 812, 899, 930, 1023, 1056, 1155, 1190, 1295, 1332, 1443, 1482, 1599, 1640, 1763, 1806, 1935, 1980, 2115, 2162, 2303, 2352, 2499, 2550, 2703, 2756, 2915
Offset: 0

Views

Author

Keywords

Comments

Summing a(n) by pairs, one gets -1, 9, 35, 77, 135, ... = A033566.
A198442(k) is a member of this sequence if k == 0 or 1 (mod 4). - Bruno Berselli, Jul 04 2017

Crossrefs

Subsequence of A214297.

Programs

  • Mathematica
    Table[(n - 1) (2 Floor[n/2] + 1), {n, 0, 60}] (* or *) LinearRecurrence[{1, 2, -2, -1, 1}, {-1, 0, 3, 6, 15}, 61]
  • PARI
    a(n)=(n\2*2+1)*(n-1) \\ Charles R Greathouse IV, Jul 02 2017
    
  • PARI
    Vec(-(1 - x - 5*x^2 - x^3 - 2*x^4) / ((1 - x)^3*(1 + x)^2) + O(x^60)) \\ Colin Barker, Jul 02 2017
    
  • Python
    def A289296(n): return (n-1)*(n|1) # Chai Wah Wu, Jan 18 2023

Formula

a(n) = A023443(n) * A109613(n).
a(n) = n^2-1 if n is even and n^2-n if n is odd.
n^2 - a(n) = A093178(n).
From Colin Barker, Jul 02 2017: (Start)
G.f.: -(1 - x - 5*x^2 - x^3 - 2*x^4) / ((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. (End)
Previous Showing 41-50 of 85 results. Next