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.

A290175 Smallest prime p such that A290174(i) = n, where i is the index of p in A000040.

Original entry on oeis.org

2, 11, 41, 19, 71, 367, 587, 131, 1151, 1987, 4253, 8831, 11839, 117497, 12269, 28279, 297793, 167711, 1748653, 1427297, 7655719, 13992553, 4594229, 12932441, 54321763, 32833217, 112155839, 231132271, 211119257, 1154494127, 137764883
Offset: 0

Views

Author

Felix Fröhlich, Jul 24 2017

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = Prime@ n, k = 0, w}, w = {p}; While[w != {}, w = Flatten@ Map[Block[{m = #, L = {}, q = 10, a, b, v}, While[q <= m, a = Floor[m/q]; b = Mod[m, q]; v = 10 q a + b; If[b >= q/10 && PrimeQ[v], AppendTo[L, v]]; q *= 10]; L] &, w]; k++]; k - 1]; With[{s = Array[f, 10^5]}, Map[If[# == 0, 0, Prime@ #] &@ First[FirstPosition[s, #] /. k_ /; MissingQ@ k -> {0}] &, Range[0, Max@ s]]] (* Michael De Vlieger, Jul 24 2017, after Giovanni Resta at A290174 *)
  • PARI
    insertzero(num, pos) = 10*(num-num%10^pos)+(num%10^pos)
    zeroprimevec_num(n) = my(w=[]); for(k=1, #Str(n)-1, my(x=insertzero(n, k)); if(ispseudoprime(x), w=concat(w, [x]))); vecsort(w, , 8)
    zeroprimevec_vec(v) = my(w=[]); for(k=1, #v, w=concat(w, zeroprimevec_num(v[k]))); vecsort(w, , 8)
    a290174(n) = my(i=0, p=prime(n), v=zeroprimevec_num(p)); while(1, if(#v==0, return(i), i++); v=zeroprimevec_vec(v))
    a(n) = my(x=1); while(1, if(a290174(x)==n, return(prime(x)), x++))
    
  • PARI
    first(n) = {n--; my(v = vector(n), todo = n, x=1); while(todo>0,
    r = a290174(x); if(0David A. Corneth, Jul 24 2017

Extensions

a(20)-a(30) from Giovanni Resta, Jul 24 2017