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.

A005145 n copies of n-th prime.

This page as a plain text file.
%I A005145 #75 Jun 08 2025 14:14:30
%S A005145 2,3,3,5,5,5,7,7,7,7,11,11,11,11,11,13,13,13,13,13,13,17,17,17,17,17,
%T A005145 17,17,19,19,19,19,19,19,19,19,23,23,23,23,23,23,23,23,23,29,29,29,29,
%U A005145 29,29,29,29,29,29,31,31,31,31,31,31,31,31,31,31,31
%N A005145 n copies of n-th prime.
%C A005145 Seen as a triangle read by rows: T(n,k) = A000040(n), 1 <= k <= n; row sums = A033286; central terms = A031368. - _Reinhard Zumkeller_, Aug 05 2009
%C A005145 Seen as a square array read by antidiagonals, a subtable of the binary operation multiplication tables A297845, A306697 and A329329. - _Peter Munn_, Jan 15 2020
%D A005145 Douglas Hofstadter, "Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought", Basic Books, 1995.
%H A005145 Reinhard Zumkeller, <a href="/A005145/b005145.txt">Rows n = 1..125 of triangle, flattened</a>
%F A005145 From Joseph Biberstine (jrbibers(AT)indiana.edu), Aug 14 2006: (Start)
%F A005145 a(n) = prime(floor(1/2 + sqrt(2*n))).
%F A005145 a(n) = A000040(A002024(n)). (End)
%F A005145 From _Peter Munn_, Jan 15 2020: (Start)
%F A005145 When viewed as a square array A(n,k), the following hold for n >= 1, k >= 1:
%F A005145 A(n,k) = prime(n+k-1).
%F A005145 A(n,1) = A(1,n) = prime(n), where prime(n) = A000040(n).
%F A005145 A(n+1,k) = A(n,k+1) = A003961(A(n,k)).
%F A005145 A(n,k) = A297845(A(n,1), A(1,k)) = A306697(A(n,1), A(1,k)) = A329329(A(n,1), A(1,k)).
%F A005145 (End)
%F A005145 Sum_{n>=1} 1/a(n)^2 = A097906. - _Amiram Eldar_, Aug 16 2022
%e A005145 Triangle begins:
%e A005145   2;
%e A005145   3, 3;
%e A005145   5, 5, 5;
%e A005145   7, 7, 7, 7;
%e A005145   ...
%t A005145 Table[Prime[Floor[1/2 + Sqrt[2*n]]], {n, 1, 80}] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Aug 14 2006 *)
%t A005145 Flatten[Table[Table[Prime[n], {n}], {n, 12}]] (* _Alonso del Arte_, Jan 18 2012 *)
%t A005145 Table[PadRight[{},n,Prime[n]],{n,15}]//Flatten (* _Harvey P. Dale_, Feb 29 2024 *)
%o A005145 (Haskell)
%o A005145 a005145 n k = a005145_tabl !! (n-1) !! (k-1)
%o A005145 a005145_row n = a005145_tabl !! (n-1)
%o A005145 a005145_tabl = zipWith ($) (map replicate [1..]) a000040_list
%o A005145 a005145_list = concat a005145_tabl
%o A005145 -- _Reinhard Zumkeller_, Jul 12 2014, Mar 18 2011, Oct 17 2010
%o A005145 (PARI) a(n) = prime(round(sqrt(2*n))) \\ _Charles R Greathouse IV_, Oct 23 2015
%o A005145 (Magma) [NthPrime(Round(Sqrt(2*n))): n in [1..60]]; // _Vincenzo Librandi_, Jan 18 2020
%o A005145 (Python)
%o A005145 from sympy import primerange
%o A005145 a = []; [a.extend([pn]*n) for n, pn in enumerate(primerange(1, 32), 1)]
%o A005145 print(a) # _Michael S. Branicky_, Jul 13 2022
%o A005145 (Python)
%o A005145 from math import isqrt
%o A005145 from sympy import prime
%o A005145 def A005145(n): return prime(isqrt(n<<3)+1>>1) # _Chai Wah Wu_, Jun 08 2025
%Y A005145 Sequences with similar definitions: A002024, A175944.
%Y A005145 Cf. A000040 (range of values), A003961, A031368 (main diagonal), A033286 (row sums), A097906.
%Y A005145 Subtable of A297845, A306697, A329329.
%K A005145 nonn,nice,tabl
%O A005145 1,1
%A A005145 _Russ Cox_