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 11-20 of 26 results. Next

A299045 Rectangular array: A(n,k) = Sum_{j=0..k} (-1)^floor(j/2)*binomial(k-floor((j+1)/2), floor(j/2))*(-n)^(k-j), n >= 1, k >= 0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, -1, -1, 1, -2, 1, 1, 1, -3, 5, -1, 0, 1, -4, 11, -13, 1, -1, 1, -5, 19, -41, 34, -1, 1, 1, -6, 29, -91, 153, -89, 1, 0, 1, -7, 41, -169, 436, -571, 233, -1, -1, 1, -8, 55, -281, 985, -2089, 2131, -610, 1, 1, 1, -9, 71, -433, 1926, -5741, 10009, -7953, 1597, -1, 0
Offset: 1

Views

Author

Keywords

Comments

This array is used to compute A269252: A269252(n) = least k such that |A(n,k)| is a prime, or -1 if no such k exists.
For detailed theory, see [Hone].
The array can be extended to k<0 with A(n, k) = -A(n, -k-1) for all k in Z. - Michael Somos, Jun 19 2023

Examples

			Array begins:
1   0  -1     1     0      -1       1         0        -1           1
1  -1   1    -1     1      -1       1        -1         1          -1
1  -2   5   -13    34     -89     233      -610      1597       -4181
1  -3  11   -41   153    -571    2131     -7953     29681     -110771
1  -4  19   -91   436   -2089   10009    -47956    229771    -1100899
1  -5  29  -169   985   -5741   33461   -195025   1136689    -6625109
1  -6  41  -281  1926  -13201   90481   -620166   4250681   -29134601
1  -7  55  -433  3409  -26839  211303  -1663585  13097377  -103115431
1  -8  71  -631  5608  -49841  442961  -3936808  34988311  -310957991
1  -9  89  -881  8721  -86329  854569  -8459361  83739041  -828931049
		

Crossrefs

Cf. A094954 (unsigned version of this array, but missing the first row).

Programs

  • Mathematica
    (* Array: *)
    Grid[Table[LinearRecurrence[{-n, -1}, {1, 1 - n}, 10], {n, 10}]]
    (*Array antidiagonals flattened (gives this sequence):*)
    A299045[n_, k_] := Sum[(-1)^(Floor[j/2]) Binomial[k - Floor[(j + 1)/2], Floor[j/2]] (-n)^(k - j), {j, 0, k}]; Flatten[Table[A299045[n - k, k], {n, 11}, {k, 0, n - 1}]]
  • PARI
    {A(n, k) = sum(j=0, k, (-1)^(j\2)*binomial(k-(j+1)\2, j\2)*(-n)^(k-j))}; /* Michael Somos, Jun 19 2023 */

Formula

G.f. for row n: (1 + x)/(1 + n*x + x^2), n >= 1.
A(n, k) = B(-n, k) where B = A294099. - Michael Somos, Jun 19 2023

A070313 a(n) = 2^n - (2*n+1).

Original entry on oeis.org

0, -1, -1, 1, 7, 21, 51, 113, 239, 493, 1003, 2025, 4071, 8165, 16355, 32737, 65503, 131037, 262107, 524249, 1048535, 2097109, 4194259, 8388561, 16777167, 33554381, 67108811, 134217673, 268435399, 536870853, 1073741763, 2147483585
Offset: 0

Views

Author

N. J. A. Sloane, May 16 2002

Keywords

Comments

Binomial transform of (-1)^n! + !n. - Paul Barry, May 13 2004
This appears as the exponent in Krotov, who writes on p. 2: "in general, two extended Hamming codes can intersect in 2^(2^m - 2m - 1) elements." - Jonathan Vos Post, Jan 13 2013
Primes appear at positions n = 4, 7, 8, 28, 32, 81, 669, 1108, ... (A344781). - R. J. Mathar, Jan 22 2013
a(n) is the total number of dollars lost when using the Martingale method (bet $1, if win then continue to bet $1, if lose then double next bet) for n trials of a wager with exactly one win, n-1 losses. For the case with exactly one loss, n-1 wins, see A165900. - Max Winnick, Jun 28 2022

Crossrefs

Second diagonal of A046739.
Cf. A344781.

Programs

Formula

E.g.f.: (exp(x))^2 - exp(x) - 2*x*exp(x). - Paul Barry, May 13 2004
From Colin Barker, Mar 21 2012: (Start)
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
G.f.: -x*(1-3*x)/((1-x)^2*(1-2*x)). (End)

A144139 Chebyshev polynomial of the second kind U(4,n).

Original entry on oeis.org

1, 5, 209, 1189, 3905, 9701, 20305, 37829, 64769, 104005, 158801, 232805, 330049, 454949, 612305, 807301, 1045505, 1332869, 1675729, 2080805, 2555201, 3106405, 3742289, 4471109, 5301505, 6242501, 7303505, 8494309, 9825089, 11306405
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [16*n^4-12*n^2+1: n in [0..40]]; // Vincenzo Librandi, May 29 2014
  • Mathematica
    lst={}; Do[AppendTo[lst, ChebyshevU[4, n]], {n, 0, 9^2}]; lst
    CoefficientList[Series[(1 + 194 x^2 + 184 x^3 + 5 x^4)/(1 - x)^5, {x, 0, 40}], x] (* Vincenzo Librandi, May 29 2014 *)

Formula

G.f.: (1 + 194*x^2 + 184*x^3 + 5*x^4)/(1 - x)^5. - Vincenzo Librandi, May 29 2014
a(n) = 16*n^4-12*n^2+1 = (4*n^2-2*n-1)*(4*n^2+2*n-1). - Vincenzo Librandi, May 29 2014
From Klaus Purath, Sep 08 2022: (Start)
a(n) = A165900(2*n)*A165900(2*n+1).
a(n) = A057722(2*n).
a(n) = 4*(Sum_{i=1..n} A193250(i)) + 1 = 4*A079414(n) + 1.
(End)
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5). - Wesley Ivan Hurt, Aug 04 2025

Extensions

Changed offset from 1 to 0 by Vincenzo Librandi, May 29 2014

A360099 To get A(n,k), replace 0's in the binary expansion of n with (-1) and interpret the result in base k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 1, 0, 1, -1, 0, 1, 0, 1, 0, 1, 1, 2, -1, 0, 1, 2, 3, -1, 1, 0, 1, 3, 4, 1, 1, -1, 0, 1, 4, 5, 5, 3, 1, 1, 0, 1, 5, 6, 11, 7, 5, 3, -1, 0, 1, 6, 7, 19, 13, 11, 7, -2, 1, 0, 1, 7, 8, 29, 21, 19, 13, 1, 0, -1, 0, 1, 8, 9, 41, 31, 29, 21, 14, 3, 0, 1, 0, 1, 9, 10, 55, 43, 41, 31, 43, 16, 5, 2, -1
Offset: 0

Views

Author

Alois P. Heinz, Jan 25 2023

Keywords

Comments

The empty bit string is used as binary expansion of 0, so A(0,k) = 0.

Examples

			Square array A(n,k) begins:
   0,  0, 0,  0,  0,   0,   0,   0,   0,   0,   0, ...
   1,  1, 1,  1,  1,   1,   1,   1,   1,   1,   1, ...
  -1,  0, 1,  2,  3,   4,   5,   6,   7,   8,   9, ...
   1,  2, 3,  4,  5,   6,   7,   8,   9,  10,  11, ...
  -1, -1, 1,  5, 11,  19,  29,  41,  55,  71,  89, ...
   1,  1, 3,  7, 13,  21,  31,  43,  57,  73,  91, ...
  -1,  1, 5, 11, 19,  29,  41,  55,  71,  89, 109, ...
   1,  3, 7, 13, 21,  31,  43,  57,  73,  91, 111, ...
  -1, -2, 1, 14, 43,  94, 173, 286, 439, 638, 889, ...
   1,  0, 3, 16, 45,  96, 175, 288, 441, 640, 891, ...
  -1,  0, 5, 20, 51, 104, 185, 300, 455, 656, 909, ...
		

Crossrefs

Columns k=0-6, 10 give: A062157, A145037, A006257, A147991, A147992, A153777, A147993, A359925.
Rows n=0-10 give: A000004, A000012, A023443, A000027(k+1), A165900, A002061, A165900(k+1), A002061(k+1), A083074, A152618, A062158.
Main diagonal gives A360096.

Programs

  • Maple
    A:= proc(n, k) option remember; local m;
         `if`(n=0, 0, k*A(iquo(n, 2, 'm'), k)+2*m-1)
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..12);
    # second Maple program:
    A:= (n, k)-> (l-> add((2*l[i]-1)*k^(i-1), i=1..nops(l)))(Bits[Split](n)):
    seq(seq(A(n, d-n), n=0..d), d=0..12);

Formula

G.f. for column k satisfies g_k(x) = k*(x+1)*g_k(x^2) + x/(1+x).
A(n,k) = k*A(floor(n/2),k)+2*(n mod 2)-1 for n>0, A(0,k)=0.
A(n,k) mod 2 = A057427(n) if k is even.
A(n,k) mod 2 = A030300(n) if k is odd and n>=1.
A(2^(n+1),1) + n = 0.

A110331 Row sums of a number triangle related to the Pell numbers.

Original entry on oeis.org

1, -1, -5, -11, -19, -29, -41, -55, -71, -89, -109, -131, -155, -181, -209, -239, -271, -305, -341, -379, -419, -461, -505, -551, -599, -649, -701, -755, -811, -869, -929, -991, -1055, -1121, -1189, -1259, -1331, -1405, -1481, -1559, -1639, -1721, -1805, -1891, -1979, -2069, -2161, -2255, -2351, -2449
Offset: 0

Views

Author

Paul Barry, Jul 20 2005

Keywords

Comments

Row sums of A110330. Results from a general construction: the row sums of the inverse of the number triangle whose columns have e.g.f. (x^k/k!)/(1-a*x-b*x^2) have g.f. (1-(a+2)x-(2b-a-1)x^2)/(1-x)^3 and general term 1+(b-a)*n-b*n^2. This is the binomial transform of (1,-a,-2b,0,0,0,...).
Hankel transform of A007054(n)-2*0^n. - Paul Barry, Jul 20 2008

Crossrefs

Cf. A028387 (absolute values). A165900 is another version.

Programs

Formula

a(n) = 1-n-n^2.
G.f.: (1-4*x+x^2)/(1-x)^3.
a(n) = binomial(n+2, 2) - 4*binomial(n+1, 2) + binomial(n, 2).
a(n) = 3*a(n-1) -3*a(n-2) +a(n-3). - Vincenzo Librandi, Jul 08 2012
E.g.f.: exp(x)*(1-2*x-x^2). - Tom Copeland, Dec 02 2013
a(n) = -A165900(n+1) (= -A028387(n-1) for n > 0). - M. F. Hasler, Mar 01 2014

A188652 First differences of A000463.

Original entry on oeis.org

0, 1, 2, -1, 6, -5, 12, -11, 20, -19, 30, -29, 42, -41, 56, -55, 72, -71, 90, -89, 110, -109, 132, -131, 156, -155, 182, -181, 210, -209, 240, -239, 272, -271, 306, -305, 342, -341, 380, -379, 420, -419, 462, -461, 506, -505, 552, -551, 600, -599, 650, -649, 702, -701, 756, -755, 812, -811, 870, -869, 930, -929, 992, -991, 1056, -1055, 1122, -1121, 1190, -1189, 1260, -1259, 1332, -1331, 1406
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 13 2011

Keywords

Crossrefs

Cf. A188653 (first differences).

Programs

  • Haskell
    a188652 n = a188652_list !! (n-1)
    a188652_list = zipWith (-) (tail a000463_list) a000463_list
  • Mathematica
    Differences[Flatten[Array[{#,#^2}&,40]]] (* Harvey P. Dale, Aug 04 2012 *)

Formula

a(2n) = 1 - a(2n-1), a(2n+1) = 2*n + 1 - a(2n).
a(n) = A000463(n+1) - A000463(n).
a(2n-1) = A002378(n-1), a(2n) = - A165900(n).
G.f.: -x^2*(-1-3*x+x^2+x^3) / ( (x-1)^2*(1+x)^3 ). - R. J. Mathar, Apr 14 2011
a(n) = (2*n+3-(2*n^2-2*n-5)*(-1)^n)/8. - Luce ETIENNE, Dec 18 2014
E.g.f.: ((4 + x - x^2)*cosh(x) - (1 - x - x^2)*sinh(x) - 4)/4. - Stefano Spezia, Jul 08 2023
Sum_{n>=2} 1/a(n) = 1 + (sqrt(5)-5)*Pi*tan(sqrt(5)*Pi/2)/(5*(sqrt(5)-1)). - Amiram Eldar, May 11 2025

A356247 Denominator of the continued fraction 1/(2 - 3/(3 - 4/(4 - 5/(...(n-1) - n/(-1))))).

Original entry on oeis.org

1, 5, 11, 19, 29, 41, 11, 71, 89, 109, 131, 31, 181, 19, 239, 271, 61, 31, 379, 419, 461, 101, 29, 599, 59, 701, 151, 811, 79, 929, 991, 211, 59, 41, 1259, 1, 281, 1481, 1559, 149, 1721, 1, 61, 1979, 2069, 2161, 1, 2351, 79, 2549, 241, 1, 2861, 2969, 3079, 3191
Offset: 2

Views

Author

Mohammed Bouras, Jul 30 2022

Keywords

Comments

Conjecture 1: Every term of this sequence is either a prime number or 1.
Conjecture 2: The sequence contains all prime numbers which ends with a 1 or 9.
Conjecture 3: Except for 5, the primes all appear exactly twice.
a(n) divides n^2 - n - 1, which is the unreduced denominator.
Conjecture: The ordered sequence of prime values is A038872. - Bill McEachen, Jul 28 2025
For a proof of Conjectures 1-3, see Cloitre (2025). - Sean A. Irvine, Aug 25 2025

Examples

			For n=2, 1/(2 - 3) = -1, so a(2)=1.
For n=3, 1/(2 - 3/(3 - 4)) = 1/5, so a(3)=5.
For n=4, 1/(2 - 3/(3 - 4/(4 - 5))) = 7/11, so a(4)=11.
For n=5, 1/(2 - 3/(3 - 4/(4 - 5/(5 - 6)))) = 23/19, so a(5)=19.
For n=6, 1/(2 - 3/(3 - 4/(4 - 5/(5 - 6/(6 - 7))))) = 73/29, so a(6)=29.
a(23) = a(79) = 23 + 79 - 1 = 101.
a(26) = a(34) = gcd(26^2 - 26 -1, 34^2 - 34 - 1) = gcd(649, 1121) = 59.
		

Crossrefs

Cf. A002327 (primes of the form k^2-k-1), A028387, A051403, A165900, A356684.

Programs

  • Mathematica
    a[n_] := ContinuedFractionK[-i-1, If[i == n, 1, i+1], {i, 1, n}] //
       Denominator;
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Aug 11 2022 *)
  • PARI
    a(n) = if (n==1, 1, n--; my(v = vector(2*n, k, (k+4)\2)); my(q = 1/(v[2*n-1] - v[2*n])); forstep(k=2*n-3, 1, -2, q = v[k] - v[k+1]/q; ); denominator(1/q)); \\ Michel Marcus, Aug 07 2022
    
  • Python
    from fractions import Fraction
    def A356247(n):
        k = -1
        for i in range(n-1,1,-1):
            k = i-Fraction(i+1,k)
        return abs(k.numerator) # Chai Wah Wu, Aug 23 2022

Formula

a(n) = (n^2 - n - 1)/gcd(n^2 - n - 1, A356684(n)).
If conjecture 3 is true, then we have:
a(n) = a(m) = n + m - 1.
a(n) = a(m) = gcd(n^2 - n - 1, m^2 - m - 1).
a(n) = a(a(n) - n + 1).

A214803 Frobenius numbers of numerators and denominators of rational numbers in order of their canonical enumeration.

Original entry on oeis.org

-1, -1, 1, -1, 5, -1, 3, 7, 11, -1, 19, -1, 5, 11, 17, 23, 29, -1, 13, 27, 41, -1, 7, 23, 31, 47, 55, -1, 17, 53, 71, -1, 9, 19, 29, 39, 49, 59, 69, 79, 89, -1, 43, 65, 109, -1, 11, 23, 35, 47, 59, 71, 83, 95, 107, 119, 131, -1, 25, 51, 103, 129, 155, -1, 13
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 29 2012

Keywords

Comments

a(n) = A020652(n) * A038567(n) - A020652(n) - A038567(n);
for n > 1: a(A015614(n)) = A165900(n-1);
a(A002088(n)) = -1.

Programs

  • Haskell
    a214803 n = a214803_list !! (n-1)
    a214803_list = [x * y - x - y | y <- [1..], x <- [1..y-1], gcd x y == 1]

A306190 a(n) = p^2 - p - 1 where p = prime(n), the n-th prime.

Original entry on oeis.org

1, 5, 19, 41, 109, 155, 271, 341, 505, 811, 929, 1331, 1639, 1805, 2161, 2755, 3421, 3659, 4421, 4969, 5255, 6161, 6805, 7831, 9311, 10099, 10505, 11341, 11771, 12655, 16001, 17029, 18631, 19181, 22051, 22649, 24491, 26405, 27721, 29755, 31861, 32579, 36289
Offset: 1

Views

Author

Kritsada Moomuang, Jan 28 2019

Keywords

Comments

Terms are divisible by 5 iff p is of the form 10*m + 3 (A030431).

Examples

			a(3) = 19 because 5^2 - 5 - 1 = 19.
		

Crossrefs

Supersequence of A091568.
Subsequence of A028387 or A165900.
Second column of A378979.
A039914 is an essentially identical sequence.

Programs

  • Maple
    map(p -> p^2-p-1, [seq(ithprime(i),i=1..100)]); # Robert Israel, Mar 11 2019
  • Mathematica
    Table[Prime[n]^2-Prime[n]-1, {n, 1, 100}] (* Jinyuan Wang, Feb 02 2019 *)
  • PARI
    a(n) = {p=prime(n);p^2-p-1;} \\ Jinyuan Wang, Feb 02 2019

Formula

a(n) = A036689(n) - 1.
a(n) = A036690(n) - A072055(n).
a(n) = A060800(n) - A089241(n).
From Amiram Eldar, Nov 07 2022: (Start)
Product_{n>=1} (1 + 1/a(n)) = A065488.
Product_{n>=2} (1 - 1/a(n)) = A065479. (End)
a(n) = A033879(A001248(n)). [Deficiency of squares of primes] - Antti Karttunen, Dec 13 2024

A243436 Numbers n such that n^2-n-1 is semiprime.

Original entry on oeis.org

8, 13, 15, 18, 19, 23, 24, 26, 28, 30, 33, 34, 35, 38, 41, 44, 50, 52, 58, 59, 62, 64, 68, 70, 72, 73, 74, 75, 76, 78, 79, 80, 82, 83, 88, 89, 91, 92, 96, 98, 99, 100, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 119, 120, 122, 123, 124, 125, 128, 130
Offset: 1

Views

Author

K. D. Bajpai, Jun 06 2014

Keywords

Examples

			13 is in the sequence because 13^2 - 13 - 1 = 155 = 5 * 31 is semiprime.
18 is in the sequence because 18^2 - 18 - 1 = 305 = 5 * 61 is semiprime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):A243436 := proc() if bigomega(n^2-n-1)=2 then RETURN (n); fi; end: seq(A243436 (), n=1..200);
  • Mathematica
    c = 0; Do[If[PrimeOmega[n^2-n-1] == 2, c++; Print[c," ",n]], {n,1,30000}];
    Select[Range[200],PrimeOmega[#^2-#-1]==2&] (* Harvey P. Dale, Sep 21 2016 *)
Previous Showing 11-20 of 26 results. Next