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.

A359122 Index of prime(n) in A068811, or -1 if prime(n) is missing from A068811.

Original entry on oeis.org

-1, 1, 2, 3, 4, -1, 5, -1, -1, 6, -1, -1, 7, -1, 8, 9, 10, -1, -1, 11, -1, -1, 12, 13, 14, -1, -1, -1, -1, 15, -1, -1, 16, -1, -1, -1, -1, -1, -1, 17, 18, -1, 19, -1, -1, -1, -1, -1, 20, -1, -1, 21, -1, -1, 22, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, 24, -1, -1, 25, -1, 26, 27, -1
Offset: 1

Views

Author

N. J. A. Sloane, Dec 18 2022

Keywords

Examples

			Prime(4) = 7 is the third term in A068811, so a(4) = 3.
Prime(6) = 13 is missing from A068811, so a(6) = -1.
		

Crossrefs

Programs

  • Mathematica
    c = 1; Reap[Do[Sow@ If[PrimeQ[10^(1 + Floor@ Log10[#]) - #], c++, -1] &[Prime[n]], {n, 73}]][[-1, -1]] (* or, generate nn <= 10^6 terms of this sequence from the bitmap: *)
    Block[{nn = 10^4, s = Flatten@ ImageData[Import["https://oeis.org/A359122/a359122.png"]] /. {1. -> 0, 0. -> 1}, c}, c = 1; Map[If[# == 0, -1, c++] &, s[[1 ;; nn]]]] (* Michael De Vlieger, Dec 18 2022 *)