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.

Showing 1-3 of 3 results.

A176271 The odd numbers as a triangle read by rows.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 13 2010

Keywords

Comments

A108309(n) = number of primes in n-th row.

Examples

			From _Philippe Deléham_, Oct 03 2011: (Start)
Triangle begins:
   1;
   3,  5;
   7,  9, 11;
  13, 15, 17, 19;
  21, 23, 25, 27, 29;
  31, 33, 35, 37, 39, 41;
  43, 45, 47, 49, 51, 53, 55;
  57, 59, 61, 63, 65, 67, 69, 71;
  73, 75, 77, 79, 81, 83, 85, 87, 89; (End)
		

Crossrefs

Programs

  • Haskell
    a176271 n k = a176271_tabl !! (n-1) !! (k-1)
    a176271_row n = a176271_tabl !! (n-1)
    a176271_tabl = f 1 a005408_list where
       f x ws = us : f (x + 1) vs where (us, vs) = splitAt x ws
    -- Reinhard Zumkeller, May 24 2012
    
  • Magma
    [n^2-n+2*k-1: k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 10 2024
    
  • Maple
    A176271 := proc(n,k)
        n^2-n+2*k-1 ;
    end proc: # R. J. Mathar, Jun 28 2013
  • Mathematica
    Table[n^2-n+2*k-1, {n,15}, {k,n}]//Flatten (* G. C. Greubel, Mar 10 2024 *)
  • SageMath
    flatten([[n^2-n+2*k-1 for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Mar 10 2024

Formula

T(n, k) = n^2 - n + 2*k - 1 for 1 <= k <= n.
T(n, k) = A005408(n*(n-1)/2 + k - 1).
T(2*n-1, n) = A016754(n-1) (main diagonal).
T(2*n, n) = A000466(n).
T(2*n, n+1) = A053755(n).
T(n, k) + T(n, n-k+1) = A001105(n), 1 <= k <= n.
T(n, 1) = A002061(n), central polygonal numbers.
T(n, 2) = A027688(n-1) for n > 1.
T(n, 3) = A027690(n-1) for n > 2.
T(n, 4) = A027692(n-1) for n > 3.
T(n, 5) = A027694(n-1) for n > 4.
T(n, 6) = A048058(n-1) for n > 5.
T(n, n-3) = A108195(n-2) for n > 3.
T(n, n-2) = A082111(n-2) for n > 2.
T(n, n-1) = A014209(n-1) for n > 1.
T(n, n) = A028387(n-1).
Sum_{k=1..n} T(n, k) = A000578(n) (Nicomachus's theorem).
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = (-1)^(n-1)*A065599(n) (alternating sign row sums).
Sum_{j=1..n} (Sum_{k=1..n} T(j, k)) = A000537(n) (sum of first n rows).

A084844 Denominators of the continued fraction n + 1/(n + 1/...) [n times].

Original entry on oeis.org

1, 2, 10, 72, 701, 8658, 129949, 2298912, 46866034, 1082120050, 27916772489, 795910114440, 24851643870041, 843458630403298, 30918112619119426, 1217359297034666112, 51240457936070359069, 2296067756927144738850, 109127748348241605689981
Offset: 1

Views

Author

Hollie L. Buchanan II, Jun 08 2003

Keywords

Comments

The (n-1)-th term of the Lucas sequence U(n,-1). The numerator is the n-th term. Adjacent terms of the sequence U(n,-1) are relatively prime. - T. D. Noe, Aug 19 2004
From Flávio V. Fernandes, Mar 05 2021: (Start)
Also, the n-th term of the n-th metallic sequence (the diagonal through the array A073133, and its equivalents, which is rows formed by sequences beginning with A000045, A000129, A006190, A001076, A052918) as shown below (for n>=1):
0 1 0 1 0 1 ... A000035
0 [1] 1 2 3 5 ... A000045
0 1 [2] 5 12 29 ... A000129
0 1 3 [10] 33 109 ... A006190
0 1 4 17 [72] 305 ... A001076
0 1 5 26 135 [701] ... A052918. (End)

Examples

			a(4) = 72 since 4 + 1/(4 + 1/(4 + 1/4)) = 305/72.
		

Crossrefs

Cf. A084845 (numerators).
Cf. A000045, A097690, A097691, A117715, A290864 (primes in this sequence).

Programs

  • Maple
    A084844 :=proc(n) combinat[fibonacci](n, n) end:
    seq(A084844(n), n=1..30); # Zerinvary Lajos, Jan 03 2007
  • Mathematica
    myList[n_] := Module[{ex = {n}}, Do[ex = {ex, n}, {n - 1}]; Flatten[ex]] Table[Denominator[FromContinuedFraction[myList[n]]], {n, 1, 20}]
    Table[s=n; Do[s=n+1/s, {n-1}]; Denominator[s], {n, 20}] (* T. D. Noe, Aug 19 2004 *)
    Table[Fibonacci[n, n], {n, 1, 20}] (* Vladimir Reshetnikov, May 07 2016 *)
    Table[DifferenceRoot[Function[{y,m},{y[2+m]==n*y[1+m]+y[m],y[0]==0,y[1]==1}]][n],{n,1,20}] (* Benedict W. J. Irwin, Nov 03 2016 *)
  • Python
    from sympy import fibonacci
    def a(n):
        return fibonacci(n, n)
    print([a(n) for n in range(1, 31)]) # Indranil Ghosh, Aug 12 2017

Formula

a(n) = (s^n - (-s)^(-n))/(2*s - n), where s = (n + sqrt(n^2 + 4))/2. - Vladimir Reshetnikov, May 07 2016
a(n) = y(n,n), where y(m+2,n) = n*y(m+1,n) + y(m,n), with y(0,n)=0, y(1,n)=1 for all n. - Benedict W. J. Irwin, Nov 03 2016
a(n) ~ n^(n-1). - Vaclav Kotesovec, Jun 03 2017
a(n) = A117715(n,n). - Bobby Jacobs, Aug 12 2017
a(n) = [x^n] x/(1 - n*x - x^2). - Ilya Gutkovskiy, Oct 10 2017
a(n) == 0 (mod n) for even n and 1 (mod n) for odd n. - Flávio V. Fernandes, Dec 08 2020
a(n) == 0 (mod n) for even n and 1 (mod n^2) for odd n; see A065599. - Flávio V. Fernandes, Dec 25 2020
a(n) == 0 (mod 2*(n/2)^2) for even n and 1 (mod n^2) for odd n; see A129194. - Flávio V. Fernandes, Feb 06 2021

A065679 If n is even, a(n) = n^2 else a(n) = n.

Original entry on oeis.org

0, 1, 4, 3, 16, 5, 36, 7, 64, 9, 100, 11, 144, 13, 196, 15, 256, 17, 324, 19, 400, 21, 484, 23, 576, 25, 676, 27, 784, 29, 900, 31, 1024, 33, 1156, 35, 1296, 37, 1444, 39, 1600, 41, 1764, 43, 1936, 45, 2116, 47, 2304, 49, 2500, 51, 2704, 53, 2916, 55, 3136, 57
Offset: 0

Views

Author

Robert G. Wilson v, Dec 03 2001

Keywords

Crossrefs

Cf. A000217, A065599, A016742 (bisection), A005408 (bisection).
Cf. A225144.

Programs

  • Magma
    /* By the third formula: */ A000217:=func; [A000217(n)+(-1)^n*A000217(n-1): n in [0..60]]; // Bruno Berselli, Jun 06 2013
  • Mathematica
    Table[ n^ (Mod[n + 1, 2] + 1), {n, 0, 60} ]
  • PARI
    a(n) = { if (n%2, n, n^2) } \\ Harry J. Smith, Oct 26 2009
    

Formula

a(n) = n^( (n+1) (mod 2) + 1 ).
O.g.f.: x*(1+x^2)*(1+4*x-x^2)/(1-x^2)^3. - Len Smiley, Dec 05 2001
a(n) = A000217(n)+(-1)^n*A000217(n-1) with A000217(-1)=0. - Bruno Berselli, Jun 06 2013
Showing 1-3 of 3 results.