A214871 Natural numbers placed in table T(n,k) layer by layer. The order of placement - T(n,n), T(1,n), T(n,1), T(2,n), T(n,2),...T(n-1,n), T(n,n-1). Table T(n,k) read by antidiagonals.
1, 3, 4, 6, 2, 7, 11, 8, 9, 12, 18, 13, 5, 14, 19, 27, 20, 15, 16, 21, 28, 38, 29, 22, 10, 23, 30, 39, 51, 40, 31, 24, 25, 32, 41, 52, 66, 53, 42, 33, 17, 34, 43, 54, 67, 83, 68, 55, 44, 35, 36, 45, 56, 69, 84, 102, 85, 70, 57, 46, 26, 47, 58, 71, 86, 103, 123
Offset: 1
Examples
The start of the sequence as table: 1....3...6..11..18..27... 4....2...8..13..20..29... 7....9...5..15..22..31... 12..14..16..10..24..33... 19..21..23..25..17..35... 28..30..32..34..36..26... . . . The start of the sequence as triangle array read by rows: 1; 3,4; 6,2,7; 11,8,9,12; 18,13,5,14,19; 27,20,15,16,21,28; . . .
Links
- Boris Putievskiy, Rows n = 1..140 of triangle, flattened
- Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
- Eric Weisstein's World of Mathematics, Pairing functions
- Index entries for sequences that are permutations of the natural numbers
Crossrefs
Programs
-
Python
t=int((math.sqrt(8*n-7) - 1)/ 2) i=n-t*(t+1)/2 j=(t*t+3*t+4)/2-n if i == j: result=(i-1)**2+1 if i > j: result=(i-1)**2+2*j+1 if i < j: result=(j-1)**2+2*i
Formula
As table
T(n,k) = (n-1)^2+1, if n=k;
T(n,k) = (n-1)^2+2*k+1, if n>k;
T(n,k) = (k-1)^2+2*n, if n
As linear sequence
a(n) = (i-1)^2+1, if i=j;
a(n) = (i-1)^2+2*j+1, if i>j;
a(n) = (j-1)^2+2*i, if i>j; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).
A255845 a(n) = 2*n^2 + 10.
10, 12, 18, 28, 42, 60, 82, 108, 138, 172, 210, 252, 298, 348, 402, 460, 522, 588, 658, 732, 810, 892, 978, 1068, 1162, 1260, 1362, 1468, 1578, 1692, 1810, 1932, 2058, 2188, 2322, 2460, 2602, 2748, 2898, 3052, 3210, 3372, 3538, 3708, 3882, 4060, 4242, 4428
Offset: 0
Comments
This is the case k=5 of the form (n + sqrt(k))^2 + (n - sqrt(k))^2.
Equivalently, numbers m such that 2*m - 20 is a square.
Links
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Crossrefs
Programs
-
Magma
[2*n^2+10: n in [0..50]]; // Vincenzo Librandi, Mar 08 2015
-
Mathematica
Table[2 n^2 + 10, {n, 0, 50}]
-
PARI
a(n)=2*n^2+10 \\ Charles R Greathouse IV, Jun 17 2017
Formula
a(n) = 2*A117951(n).
From Vincenzo Librandi, Mar 08 2015: (Start)
G.f.: 2*(5 - 9*x + 6*x^2)/(1 - x)^3.
a(n) = a(-n) = 3*a(n-1) - 3*a(n-2) + a(n-3). (End)
From Amiram Eldar, Mar 28 2023: (Start)
Sum_{n>=0} 1/a(n) = (1 + sqrt(5)*Pi*coth(sqrt(5)*Pi))/20.
Sum_{n>=0} (-1)^n/a(n) = (1 + sqrt(5)*Pi*cosech(sqrt(5)*Pi))/20. (End)
E.g.f.: 2*exp(x)*(5 + x + x^2). - Elmo R. Oliveira, Jan 25 2025
Extensions
Edited by Bruno Berselli, Mar 13 2015
A361696 Semiprimes of the form k^2 + 5.
6, 9, 14, 21, 69, 86, 201, 329, 446, 489, 581, 681, 734, 789, 905, 1094, 1769, 1941, 2606, 2921, 3254, 3369, 3849, 3974, 4101, 4629, 4766, 6729, 7061, 7401, 8105, 8654, 9609, 9806, 10409, 10821, 11669, 12326, 13929, 17429, 17961, 19049, 20741, 23109, 23721, 24341, 27561, 30281, 31334, 32405
Offset: 1
Examples
69 is a term because 8^2 + 5 = 69 = 3*23.
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Select[Range[200]^2 + 5, PrimeOmega[#] == 2 &] (* Paolo Xausa, Aug 21 2025 *)
-
PARI
isok(k) = issquare(k-5) && (bigomega(k)==2); \\ Michel Marcus, Mar 27 2023
Formula
a(n) = A242333(n)^2 + 5.
Comments