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.

A245508 Smallest double square (cf. A001105) greater than n-th prime.

Original entry on oeis.org

2, 8, 8, 8, 18, 18, 18, 32, 32, 32, 32, 50, 50, 50, 50, 72, 72, 72, 72, 72, 98, 98, 98, 98, 98, 128, 128, 128, 128, 128, 128, 162, 162, 162, 162, 162, 162, 200, 200, 200, 200, 200, 200, 200, 200, 200, 242, 242, 242, 242, 242, 242, 242, 288, 288, 288, 288
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 25 2014

Keywords

Comments

For n > 2: prime(n) < a(n) < 2*prime(n) and a(n) = A245499(A000040(n),2).

Crossrefs

Programs

  • Haskell
    import Data.List (genericIndex)
    a245508 n = genericIndex a245508_list (n-1)
    a245508_list = f a000040_list a001105_list where
       f ps'@ (p:ps) xs'@(x:xs) = if p <= x then x : f ps xs' else f ps' xs
    
  • Mathematica
    Module[{nn=60,ds},ds=2 Range[0,Ceiling[Sqrt[Prime[nn]]]]^2;Join[ {2},Table[ SelectFirst[ds,#>Prime[n]&],{n,2,nn}]]] (* Harvey P. Dale, Jan 07 2020 *)
  • PARI
    a(n) = my(k=prime(n)+(n!=1)); while (! issquare(k/2), k+=2); k; \\ Michel Marcus, Jan 24 2022