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.

A057062 Let R(i,j) be the infinite square array with antidiagonals 1; 2,3; 4,5,6; ...; the n-th prime is in antidiagonal a(n).

This page as a plain text file.
%I A057062 #41 Jun 19 2024 15:40:59
%S A057062 2,2,3,4,5,5,6,6,7,8,8,9,9,9,10,10,11,11,12,12,12,13,13,13,14,14,14,
%T A057062 15,15,15,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,21,
%U A057062 22,22,22,22,23,23,23,23,24,24,24,24,25,25
%N A057062 Let R(i,j) be the infinite square array with antidiagonals 1; 2,3; 4,5,6; ...; the n-th prime is in antidiagonal a(n).
%C A057062 The smallest integer in the j-th antidiagonal is A000124(j-1). So a(n) is the index j such that A000124(j-1) <= prime(n) < A000124(j). - _R. J. Mathar_, Dec 02 2011
%H A057062 T. D. Noe, <a href="/A057062/b057062.txt">Table of n, a(n) for n = 1..1000</a>
%F A057062 a(n) = round(sqrt(2*prime(n))). - _Vladeta Jovovic_, Jun 14 2003
%e A057062 The array begins
%e A057062    1  3  6 10 15 ...
%e A057062    2  5  9 14 ...
%e A057062    4  8 13 ...
%e A057062    7 12 ...
%e A057062   11 ...
%e A057062   ...
%e A057062 The third prime, 5, is in the 3rd antidiagonal, so a(3) = 3.
%t A057062 Table[Round[Sqrt[2*Prime[n]]], {n, 100}] (* _T. D. Noe_, Dec 03 2011 *)
%o A057062 (PARI) a(n)=(sqrtint(8*prime(n))+1)\2 \\ _Charles R Greathouse IV_, Jul 26 2012
%o A057062 (Haskell)
%o A057062 a057062 n = a057062_list !! (n-1)
%o A057062 a057062_list = f 1 [1..] where
%o A057062    f j xs = (replicate (sum $ map a010051 dia) j) ++ f (j + 1) xs'
%o A057062      where (dia, xs') = splitAt j xs
%o A057062 -- _Reinhard Zumkeller_, Jul 26 2012
%o A057062 (Python)
%o A057062 from math import isqrt
%o A057062 from sympy import prime
%o A057062 def A057062(n): return isqrt(prime(n)<<3)+1>>1 # _Chai Wah Wu_, Jun 19 2024
%Y A057062 Cf. A057045, A057048, A022846, A057057, A057054. A066888 counts how many times each positive integer appears in this sequence.
%Y A057062 Cf. A010051.
%K A057062 nonn
%O A057062 1,1
%A A057062 _Clark Kimberling_, Jul 30 2000